form里面的代码如下:DataSet ds = new DataSet();
private void button1_Click(object sender, EventArgs e)
{
DataSet set = ds.GetChanges();
DataRowState state= ds.Tables[0].Rows[0].RowState;
} private void Form3_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("server=(local);uid=sa;database=pubs");
SqlDataAdapter da = new SqlDataAdapter("select * from authors", con);
con.Open();
da.Fill(ds);
con.Close();
this.textBox1.DataBindings.Add("Text", ds, "Table.au_fname");
this.textBox2.DataBindings.Add("Text", ds, "Table.au_lname");
}问题是我对绑定数据后的textbox1进行了数据修改
dataset里面的数据相应也作了修改
但是奇怪的地方是
DataSet set = ds.GetChanges();
得到set为空,这不明显不统一吗,数据都改变了,行的状态却还是原来的未改变状态
这是什么原因?还是漏洞?
private void button1_Click(object sender, EventArgs e)
{
DataSet set = ds.GetChanges();
DataRowState state= ds.Tables[0].Rows[0].RowState;
} private void Form3_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("server=(local);uid=sa;database=pubs");
SqlDataAdapter da = new SqlDataAdapter("select * from authors", con);
con.Open();
da.Fill(ds);
con.Close();
this.textBox1.DataBindings.Add("Text", ds, "Table.au_fname");
this.textBox2.DataBindings.Add("Text", ds, "Table.au_lname");
}问题是我对绑定数据后的textbox1进行了数据修改
dataset里面的数据相应也作了修改
但是奇怪的地方是
DataSet set = ds.GetChanges();
得到set为空,这不明显不统一吗,数据都改变了,行的状态却还是原来的未改变状态
这是什么原因?还是漏洞?
解决方案 »
- C#中一个Lable标签怎么显示数据库里的一个字符串
- WCF iis的问题
- C#-NotifyIcon事件驱动问题···
- 如何指定lable 字体的颜色?
- c# winform中如何制作这样的按钮?
- The item "obj\Release\SSNERP.FmRptProjectSummary.resources" was specified more than
- 高分求webform问题 用c#如何调用windows 2000域帐户,同时能给帐户授权?
- 打印问题,winform下。
- windows2003中使用ASP.net的问题
- 急救!
- 做项目时 按照正常流程需要写哪写文档,每个文档的作用是什么,以及面向哪写群体?
- c# 控制台程序 问题
this.BindingContext[ds, "tablename"].EndCurrentEdit();