How to update dataGridView and also update database?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ocean
    New Member
    • Mar 2007
    • 6

    How to update dataGridView and also update database?

    i have this code:

    Code:
    string conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Khai\\Documents\\MyNum…
    string queryM = "SELECT * FROM magnum WHERE todayDate = #" + pickedDate.Date + "#";
    OleDbDataAdapter dAdapterM = new OleDbDataAdapter(queryM, conString);
    OleDbCommandBuilder cBuilderM = new OleDbCommandBuilder(dAdapterM);
    DataTable dtableM = new DataTable();
    
    dAdapterM.Fill(dtableM); 
    BindingSource bSourceM = new BindingSource();
    bSourceM.DataSource = dtableM;
    magnumView.DataSource = dtableM; 
    
    dAdapterM.Update(dtableM);

    when the data on the dataGridView change, the original database also update by it self, but it cant be done.. i have search for many place.. but didn get the thing also
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Could you be more clear? Can you clearly define what you want to do?

    Comment

    Working...