Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
LINQ To SQL:Update an entity
WhatsApp
Vijai Anand Ramalingam
14y
5.2
k
0
0
25
Blog
EmpDetails Table:
Code:
To update an entity.
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
LINQ
{
class
Program
{
static
void
Main(
string
[] args)
{
DataClassesDataContext
dc =
new
DataClassesDataContext
();
var
empQuery = (
from
emp
in
dc.EmpDetails
where
emp.Dept ==
"MOSS"
select
emp).First();
empQuery.Name =
"Vijay"
;
dc.SubmitChanges();
}
}
}
People also reading
Membership not found