datagridview content inserting for new item and updating for existing item

Posted by Akash1985 under C# on 8/23/2011 | Points: 10 | Views : 1044 | Status : [Member] | Replies : 1
i have more than 10 row data in my datagridview.some of them are new and some of them already exists. i need to write query to insert for new item and update for existing item can i do that?


Posted by: Ndebata on: 8/23/2011 [Member] Starter | Points: 25

You must have some logic that differentiate New and Existing items. Lets say some ID property, for new one it will not hold any value, but for existing those values will be there in your table. First check whether it is there in your table if yes update the record else insert the same.

Akash1985, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response