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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Raaj KumarPosted Feb 21, 2010, 12:46 AM
Have a look at this site. I guess it would help you.
http://dotnetslackers.com/articles/csharp/IntroducingLINQ1.aspx
Regards,
Raaj
paul danielPosted Feb 23, 2010, 8:31 AM
http://weblogs.asp.net/scottgu/archive/2006/05/14/Using-LINQ-with-ASP.NET-_2800_Part-1_2900_.aspx
Van MatizPosted Feb 20, 2010, 9:50 PM
Van MatizPosted Feb 20, 2010, 9:48 PM
Raaj KumarPosted Feb 20, 2010, 5:46 AM
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