Question : save datagrid data to table

I have a datagird in vb.net form,which dispalys records from a table.
Now when the user make changes then  call accept changes  data not getting updated back to the table

      servername = "brioeporting"
        userid = "brioreporting"
        password = "brio"
        provider = "msdaora"
        conn.ConnectionString = "Provider=" & provider & ";" _
        & "Data Source=" & servername & ";" _
        & "User Id=" & userid & ";" _
        & "Password=" & password & ";"

        Dim Rdr As New OleDb.OleDbDataAdapter("select * from FIN_ENTITYNAMES1 order by enitity_id", conn.ConnectionString)
        Dim datasetentity As New DataSet("FIN_ENTITYNAMES1")
        Rdr.Fill(datasetentity, "FIN_ENTITYNAMES1")
        DataGrid1.DataSource = datasetentity
        DataGrid1.DataMember = "FIN_ENTITYNAMES1"
      datagrid1.acceptchange()

please help experts

Regards
Robin

Answer : save datagrid data to table

The following section of code 'dtchanged = ord.dtOrderLines.GetChanges();' that I posted above will get all the changes that you made in your grid, and populate DataTable dtchanged with it.  This means that if you changed 10 records, added 3 and deleted 2, dtchanged will contain all those records.

The following code
 if (dtchanged != null)
                    {
                         ord.dataAdapter.Update(dtchanged);
                         ord.dtOrderLines.AcceptChanges();
                    }
will make all the necessary updates, deleting records that were deleted, as well as creating inserted records.  

I guess that's what you mean by 'mass update'.
Random Solutions  
 
programming4us programming4us