Question How To Save Combobox1 Data and Multiple Data in Datagridview using Button1

AskQuestion

New member
Joined
Apr 29, 2014
Messages
1
Programming Experience
Beginner
Help Pls. Sir/Mam How to Code Save this into Database Access With Combobox and Multiple Data inserted in Datagridview Using Button1(SAVE), If you have Sample Code or any reference site that can help Just post it thanks.

VS2008 Vb,net
Access Database MDB
Expected Output in Database Access
Encoder Customer Remarks ItemNo Desc Price
Encoder1 Customer1 UserInput 0001 Details 0001 100
Encoder1 Customer1 UserInput 0002 Details 0002 200
Encoder1 Customer1 UserInput 0003 Details 0003 300



lpbuzi2x1
 

Attachments

  • Help.jpg
    Help.jpg
    42.8 KB · Views: 31
1. Create a DataTable and build the appropriate schema, either manually or else by call Fill or FillSchema on a data adapter containing the appropriate query.
2. Bind that DataTable to a BindingSource by assigning it to the DataSource property.
3. Bind the BindingSource to the DataGridView by assigning it to the DataSource property.
4. When ready to save, call Update on a data adapter (the same one as used in step 1 if one was used) and pass the DataTable as an argument.

In step 4, the data adapter must have appropriately populated InsertCommand, UpdateCommand and DeleteCommand properties as required. You can create those yourself or let a command builder do it for you. The link below provides examples using a data adapter with and without a command builder:

Retrieving and Saving Data in Databases
 
Back
Top