Subscribe to Subscribers
Talk to Webmaster Tony John

Forums » .NET » .NET »

updation


Posted Date: 23 Jul 2006      Posted By:: santhosh anand     Member Level: Bronze    Member Rank: 0     Points: 2   Responses: 1



hi

i am working in windows forms. I have a form in that i put one datagrid. the datagrid was populated with the data in a oracle table thru dataset. Now i want to update the oracle table from the cahnged values in the datagrid. How it possible. wen i try with accept change method the dataset is updating. but not database. so any body please describe me about this detail. and please send me any sample code so that i can understand how it will work.

thnks
san.




Responses

#64280    Author: m.sunil kumar      Member Level: Silver      Member Rank: 0     Date: 23/Jul/2006   Rating: 2 out of 52 out of 5     Points: 2

You need to configure a dataadapter with the updated dataset and just issue an update command.

<code>
SqlDataAdapter da = new SqlDataAdapter("select * from tbl1",con);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
da.Update(ds);
</code>

Note: The commandbuilder object is used to configure the dataadapter with the insert, update and delete statements and its mandatory that your table consists a primary key.



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : order of the events in a web form
Previous : DataTable
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.