-
April 24th, 2007, 06:43 PM
#1
Update database records
Okay i have set an oledbConnection, my adapters and datasets. Added a datagrid to my form and in the forms load event set up the connection and filled the datagrid.
OleDbConnection1.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=dataBase.mdb"
DataAdapter1.Fill(DataSet11)
Now how would i update the dataBase if i add new information in the datagrid?
Thanks
-
April 25th, 2007, 07:11 AM
#2
Re: Update database records
One way is to generate the dataAdapter's commands using oleDbCommandBuilder object that builds InsertCommand ,DeleteCommand,Update Command for the dataAdapter and then use the Update Command of dataBase to make changes into dataSource.
Link
You can also specify the SelectCommand, InsertCommand ,DeleteCommand,Update Command in code and then use them to update the dataSource after editting in dataTable bound to dataGrid.Post
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|