注册 登录
编程论坛 C# 论坛

强类型 DataSet 删除数据库中的记录

lyf4089835 发布于 2014-08-20 15:49, 508 次点击
程序代码:

            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);
            }


运行之后,内存中记录删除,但数据库却没删除.....为什么?
3 回复
#2
lyf40898352014-08-20 21:05
回复 2 楼 yh2014wy
我用update 提交更新了啊
#3
鹏哥v52014-08-21 15:30
这是要干嘛的
1