0 Replies - 862 Views - Last Post: 28 November 2012 - 01:01 AM Rate Topic: -----

#1 ahmed_one   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-November 12

Save data from Unbound C# DataGridView to Sql Server and then Bind

Posted 28 November 2012 - 01:01 AM

I am a newbie to C#, my development environment is:

Visual Studio 2010 Ultimate Edition
Sql Server 2005
Programming Language C# 2010

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


Is This A Good Question/Topic? 0
  • +

Page 1 of 1