datagrid data to access database
-
I need help with updating an access database table(access database is included in my project). my data comes from an xml that will periodically be updated and displayed on a DataGrid field. I manage to display the data onto datagrid and now I want to copy the displayed data into an access database table. Does anyone knows how to do that? Thanks for your help Maria
-
I need help with updating an access database table(access database is included in my project). my data comes from an xml that will periodically be updated and displayed on a DataGrid field. I manage to display the data onto datagrid and now I want to copy the displayed data into an access database table. Does anyone knows how to do that? Thanks for your help Maria
1. Iterate through the rows in your DataGrid control. 2. For each row, execute an
INSERT INTO...VALUES
DML query that inserts a row of data into a table in your Access database. This query could be constructed dynamically as a string or it could be a parametetized query stored in the Access database.Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
1. Iterate through the rows in your DataGrid control. 2. For each row, execute an
INSERT INTO...VALUES
DML query that inserts a row of data into a table in your Access database. This query could be constructed dynamically as a string or it could be a parametetized query stored in the Access database.Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
Thanks Paul, This is what I have done so far but it doesnt work: ################################################################## Dim newRows as DataRow = DatabaseDataSet.Tables("Table1").NewRow() Dim dr As DataRow For Each dr In Me.DataGrid1.Rows newRows = dr DatabaseDataSet.Tables("Table1").Rows.Add(newRows) Next ################################################################## Please help! Maria
-
Thanks Paul, This is what I have done so far but it doesnt work: ################################################################## Dim newRows as DataRow = DatabaseDataSet.Tables("Table1").NewRow() Dim dr As DataRow For Each dr In Me.DataGrid1.Rows newRows = dr DatabaseDataSet.Tables("Table1").Rows.Add(newRows) Next ################################################################## Please help! Maria
What do you mean 'it doesn't work'? What do you expect it to do? Do you get an error? You need to be more specific. All your code appears to do is add rows to a Table in a DataSet. Where is your code to connect and add the data to your Access database? I suggested a way of doing this in my previous post.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush