|
-
Jan 11th, 2008, 04:07 AM
#1
Thread Starter
Hyperactive Member
DataTable Problem
Hello techz,,,
I am building a sqltool in which all tables will be listed in a Listbox, on selection of list box item (table).., the data of the table will be loaded to the grid...
I need to update the grid on click of a save button, i am able to save some of the tables, but some tables are not able to save ...
I am using SqlcommandBuilder class.
I have read a document that the tables without primary keys is not able to update from a datatable...
Please help to clarify ...
thankzzz
Last edited by sureshvijayan; Jan 11th, 2008 at 05:44 AM.
gh
-
Jan 11th, 2008, 09:33 PM
#2
Re: DataTable Problem
In order to update a record you have to be able to identify it. The purpose of a primary key is to uniquely identify each row in the table. If your table has no primary key the a CommandBuilder will not generate an UPDATE or DELETE statement because it has no way to uniquely identify each row.
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
|