强类型 DataSet 删除数据库中的记录
程序代码:
FeifeiDataSet fds = new FeifeiDataSet();
FeifeiDataSetTableAdapters.studentTableAdapter stuTblapt = new FeifeiDataSetTableAdapters.studentTableAdapter();
stuTblapt.Fill(fds.student);
FeifeiDataSet.studentRow reStuRow = fds.student.FindBystu_id(10010);
fds.student.RemovestudentRow(reStuRow);
stuTblapt.Update(reStuRow);
foreach (FeifeiDataSet.studentRow sr in fds.student.Rows)
{
Console.WriteLine(sr.stu_id + " " + sr.stu_name + " " + sr.stu_address);
}
运行之后,内存中记录删除,但数据库却没删除.....为什么?







