//修改数据
protected void EditData()
{
DataContext dbContext = new DataContext("data Source=192.168.0.66;database=LSS1;user id=sa;pwd=****");
Table<User> users = dbContext.GetTable<User>();
var result = from user in users
where user.UserName == this.txtUserName.Text.Trim()
select user;
foreach (User u in result)
{
u.Age = Convert.ToInt32(this.txtNewAge.Text.Trim().ToString());
}
dbContext.SubmitChanges();
}