saving data from a datagrid to a database
Hello,
I have a datagrid which l want to save the contents to the database. I am not sure how to do this. Would l have to save one row at a time, or can l save everything and at once. I am using C# with SQL Server 2000. I normally write stored procedures for database operations. But with the datagrid I am not sure how this is done.
Some code examples would be very grateful.
Thanks in advance,
Steve
Re: saving data from a datagrid to a database
That depends on how you populated the datagrid and dataset in the first place. If you used a dataadapter, then any changes you made in the datagrid should be reflected in your dataset. You can then run the dataadapater's update method and the rows which have been changed will be updated back to the database.
If that is not the case then you'll need to tell us how you populated.