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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box selection updated to different Table

Status
Not open for further replies.

basquiat

Technical User
Jun 1, 2005
22
ZA
Hi

I have (I'm sure) a very basic SQL Server 2000 and VB.NET question;

To simplify:
I've got two tables on SQL "Employees" and "Transactions";
"Employees" has one Field... "EmpNo" and "Transactions" has 3 Fields...
1) "TransNo" (Primary and Identity)
2) "EmpNo" (Foreign Key)
3) "Amount"

Now I've got 1 form with a combo box populated by the "EmpNo" from the "Employees" table and 1 text box;
I want the user to select his name from the combo box enter an amount in the text box and after clicking "update" it should save the info in the "Transactions" table;

How do I get the selection in the combo box to save to the "Transactions" table?;

I've created an "OleDbDataAdapter" and generated a "DataSet";

Thank in advance;


 
Firstly, you should use the SqlConnection and SqlDataAdapter with SQL Server, as these were designed specifically to work with SQL Server.

As to your question, check out these links:

ADO.NET: Update a Database from a DataSet

All You Need To Know About ADO.NET: Part 1/2

All You Need To Know About ADO.NET: Part 2/2

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thanks Jebenson;

Nice links! Thanks you;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top