Storing to database from datagrid
I want to store a table from data grid to a table in database. I defined a dataset. Is is possible to save the whole table or I have to save each row separately? How can I do it?
Thank you.
I want to store a table from data grid to a table in database. I defined a dataset. Is is possible to save the whole table or I have to save each row separately? How can I do it?
Thank you.
I would use a DataAdapter to store a table to a database.
Your description isn't very specific, but generally what I would do is the following:
Create a connection to the database.
Create a DataAdapter using the connection.
Then either use VIsual Studio's built in SQL builder/DataAdapter Wizard or explicitly write the appropriate SQL.
Then you can call the DataAdapter's Update method passing it the appropriate dataTable or dataSet.
The individual steps can be much more complicated depending on what exactly you're trying to do.
If you provide more detail, I might be able to provide more guidance.
Good luck,
Nate
Hi,
I have set a datagrid's datasource property to a DataTable, After making some changed i want to get updated this table to the database,
This datatable may on based of some condition e.g where clasuse ,
How will i update this datatable to the database
Himanshu Kansal
Noida