November 29th, 2012, 06:03 AM
Save data from Unbound DataGridView to Sql Server 2005 and then Bind to records C#
Hi All CodeGurus,
I am a newbie to C#, my development environment is:
Visual Studio 2010 Ultimate Edition
Sql Server 2005
Programming Language C#**
I've a form with Unbound Datagridview, from which data is save to Sql Server 2005 by looping through For..Each and pass SQL INSERT Statement when user clicks Save button without any problem.
Now what I need is a way that for same Save button, if data is saved in Sql Server then DataGridView will bind to that records so that if user want to Update/Delete/Add data he/she just need to edit the data and again press Save button. All records will share the same unique ID. It's a products database, and when user click save it will generate a transaction Id same for all products user enter when saving. So I think I need to generate a Select statement and retrieve all those records user save through that Unique ID, but then how to bind it to DataGridView datasource and how to Update/Delete through SqlAdapter or other?
Thanks and best regards
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!