Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
update the record using button click
using linq query
Posted
Comments
Rutvik Dave 2-Oct-12 11:34am    
You should learn to search on google first (very imp skill to have for a technical person), because you are wasting time waiting for someone to answer the question, which has been asked so many times already. try the following link.

http://www.google.com/#hl=en&sclient=psy-ab&q=Update+the+record+using+LINQ+to+Sql&oq=Update+the+record+using+LINQ+to+Sql&gs_l=hp.3..0i22.15048.21939.1.24710.13.13.0.0.0.5.346.2877.0j5j7j1.13.0.les%3B..0.0...1c.1.TpCQyjNW990&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=1e4e8e477cbfad52&biw=1440&bih=730

Good luck

Its very easy to update record using linq to sql here is the code;

DataClasses1DataContext db = new DataClasses1DataContext();
State st = db.States.Single(aa => aa.StateID == 127);
st.State1 = "Test State";

State st1 = db.States.Single(aa => aa.StateID == 143);

db.States.DeleteOnSubmit(st1);
db.SubmitChanges();
 
Share this answer
 
Comments
mohit jain 2-Oct-12 5:43am    
i don't want hardcoded values..
plz send without hardecoded values..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900