Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > [c#]forgive me about the "million" post for dgv update database
 

[c#]forgive me about the "million" post for dgv update database

I've looking around a lot. No examples were good for me (obviously for my non-capacity).

I have a simple form, where user choose some item from a combobox. After this, a datagridview show the data related to values in combobox.

I only need to make some changes in datagridview, and then update the database.

I've try with sqlparameter, with the single "update" query, but still doesnt work.

Very thx and hope somebody can help me.
Raoul_BennetH  Monday, September 18, 2006 2:07 PM

If you use a tableAdapter, you may try this

this.Validate();

this.customersBindingSource.EndEdit(); 
this.customersTableAdapter.Update(this.northwindDataSet.Customers);
Or sometinglike this

cm =(CurrencyManager)this.BindingContext[northwindDataSet,"Customers"];

northwindDataSet is a dataset while "customers" is table in it.
Please tell me whether they work or not.
Wang Chi  Tuesday, September 19, 2006 1:59 AM

If you use a tableAdapter, you may try this

this.Validate();

this.customersBindingSource.EndEdit(); 
this.customersTableAdapter.Update(this.northwindDataSet.Customers);
Or sometinglike this

cm =(CurrencyManager)this.BindingContext[northwindDataSet,"Customers"];

northwindDataSet is a dataset while "customers" is table in it.
Please tell me whether they work or not.
Wang Chi  Tuesday, September 19, 2006 1:59 AM

You can use google to search for other answers

Custom Search

More Threads

• Child Table and Lookup Table
• DataTable Acts As Intermediator For DataGridView
• Server Explorer does not list my Access queries that require parameters
• using IDataErrorInfo to validate bound complex/aggregate types.
• Xceed DataBound Master Detail Grid Control Problems
• DataGridView Struggle - Password chars, delete buttons and dialog box
• Selecting a row on keypress event
• DataGridView Refresh issue
• Drop Down List "blanking out" first entry
• Can the DataGridView accept Enter instead of Shift+Enter for a new line?