.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

update table using datagridview content

Posted By: Jayakumar     Posted Date: March 05, 2010    Points:2   Category :Windows Application
hi,

i need suggestion for windows application as i am new to windows application.

first--if binding datagridview on a button click
second--i want to pass the data/values from datagridview(on content click) to the textboxes.
three- i want to edit and save the textbox values again to table.

how it can be accomplished..

Responses
Author: Syed Shakeer Hussain             
Posted Date: March 05, 2010     Points: 5   
Author: Syed Shakeer Hussain             
Posted Date: March 05, 2010     Points: 5   

Hi,
to save the textboxes values:-
SqlCommand cmd=new SqlCommand("update tablename set name='"+txtmarks.Text+"',marks="+txtmarks.Text+" where id="+txtid.Text+"",conn);
SqlDataAdapter da=new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
da.Fill(ds,"tablename");
DataGridView1.DataSource=ds.Tables["tablname"];

Author: Syed Shakeer Hussain             
Posted Date: March 05, 2010     Points: 5   
Author: Jayakumar             
Posted Date: March 05, 2010     Points: 5   

hi guys

thank you for ur code guide...

i will try these things and let u know the result.

thanx 1 more

Author: Jayakumar             
Posted Date: March 05, 2010     Points: 5   

thanx



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend