You might create a new column name new Listing Id, in your update command pass the primary key and the New listing Id. Rows) return dt; So here is the answer, thought Id post it for any to see!
If you are using Listing Id as the ref key in the update proc of your sqladapter it won't work. As you can see from the code, I called the Find method to find the row and called the Delete method of the Data Row.After that I called the Data Adapter's Update method to save the changes to the database table. I can't imagine this is the optimal coding for data table update operations, but it might be.Is this a possibility in LINQ (I'm completely new to LINQ)?The Find method returns the row with Customer Id = Tst ID.
After that I assign values of the row and call the Data Adapter's Update method. Updating data using the Data Adapter's Update method sender, System. Listing 5-50 deletes the row with the value Tst ID.
Note: The Tables member of Data Set represents all Data Table objects attached to a Data Set. Adding a Data Row to a Data Table In this example, I'll show you how to add edit, and remove, data from the Northwind database.
Listing 5-46 Creates a new Data Row, sets the data of Data Row members, and adds rows to the table using the Add method of Data Table. I'll display the result of the Customers table in a Data Grid after adding, updating, and deleting data from the table.
After that I assign values of the row and call the Data Adapter's Update method. Updating data using the Data Adapter's Update method Deleting a row is simple.
Listing 5-50 deletes the row with the value Tst ID.
For example, if you call Delete on a row on the Data Set, then when Update is called on the Data Adapter, the Delete Command of the Data Adapter will be called using the particular row in the Data Set.