I am new to LINQ, I am not able to perform update operation. can anybody help?
LINQ Doubt
Hi,
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Raaj KumarRank #7,836 · 233 reputationPosted Feb 20, 2010, 7:46 PM EST
Have a look at this site. I guess it would help you.
http://dotnetslackers.com/articles/csharp/IntroducingLINQ1.aspx
Regards,
Raaj
Raaj KumarRank #7,836 · 233 reputationPosted Feb 20, 2010, 12:46 AM EST
Could you please tell me what kind of datasource you are using ? If you are using XML please have a look at this,
and the code behind is ,
XDocument d = XDocument.Load(@"..\Employee.xml");
var list = from XElement e in d.Descendants("Employee")
where e.Attribute("ID").Value == "2"
select e;
foreach (XElement e in list.ToArray())
{
e.SetElementValue("Name", "asdasdas");
}
d.Save(@"..\Employee.xml");
Regards,
Raaj
Van Matiz18 reputationPosted Feb 20, 2010, 4:48 PM EST
Van Matiz18 reputationPosted Feb 20, 2010, 4:50 PM EST
paul daniel189 reputationPosted Feb 23, 2010, 3:31 AM EST
http://weblogs.asp.net/scottgu/archive/2006/05/14/Using-LINQ-with-ASP.NET-_2800_Part-1_2900_.aspx