I have been using databinding and datasets in my last few applications, but there's something that I'm missing somewhere. I'm so close, I can see the potential, but something isn't quite right.
DataGridViews and DataSets seem to be very easy to set up when there is a direct one-to-one correlation between tables in a database, and grids on a form. Unfortunately, this is never the case.
My problem is usually a simple one. Say I have a table (Table1) in my database with an autoinc primary key, some data, and then an employeeID referring to a different table (Table2). I would like my DataGridView to display all of the rows in Table1, but substitute employeeID for the employee's name, taken from Table2. There is a foreign key relationship on employeeID, and it is the primary key of Table2.
It should be so simple, but I can't seem to do it without modifying the DataSet, and that doesn't seem right. Can anyone clue me in as to where I'm going wrong?
DataGridViews and DataSets seem to be very easy to set up when there is a direct one-to-one correlation between tables in a database, and grids on a form. Unfortunately, this is never the case.
My problem is usually a simple one. Say I have a table (Table1) in my database with an autoinc primary key, some data, and then an employeeID referring to a different table (Table2). I would like my DataGridView to display all of the rows in Table1, but substitute employeeID for the employee's name, taken from Table2. There is a foreign key relationship on employeeID, and it is the primary key of Table2.
It should be so simple, but I can't seem to do it without modifying the DataSet, and that doesn't seem right. Can anyone clue me in as to where I'm going wrong?