Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid/details on a form, linking 2 tables - VB.NET 2005 & SQL 2000

Status
Not open for further replies.

adrianjohnson

Programmer
May 16, 2002
145
GB
I have 2 tables in a SQL Server 2000 database - Users and Department. The link between them is an integer field, ID.

In my form in VB.NET 2005, I have a datagrid, and some details fields, showing the data from the Users table. So when a user selects a cell in the datagrid, the details section is filled with the relevant information (from the Users table).

However, as the link to the Department table is an integer, I don't want to display a combo box with the integer value in - I'd rather populate the combo box with all the departments, but the correct one is displayed when the user selects the cell in the datagrid. E.g. if the user selects Bob the User, his details appear in the correct section including the name of the department (read from the Department) table, not the id value.

At the moment, I have a DataAdpater, DataView and DataSet for each table. I'm not sure that's the best way of doing things - I found it better to code everything, rather than use the wizards.

Any help would be appreciated.

Thanks,

Adrian Johnson

Let me know if you need to see my code. I wondered whether a description would be sufficient (as it's not a problem with code, as such).
 
You'll want to repost to a .Net forum. This is a VB6 forum.

HTH

Bob
 
Is it? Ooops! I thought it was for using all versions of VB and databases.

Will post it there now.

Thanks Bob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top