private void Form1_Load(object sender, EventArgs e)
{
conn.ConnectionString = "Data Source=.;Initial Catalog=NewsCollection;Integrated Security=True";
cmd.CommandText = "select * from news";
cmd.Connection = conn;
adapter.SelectCommand = cmd;
adapter.Fill(ds);
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", ds.Tables[0], "newsTitle"));
}
我这样将textBox3绑定到数据源,如果我改变textBox3的值,在提交时时为什么不能改变数据库的值呢?
在Delphi中,
将DbText绑定到ADOquery1
在改变前
ADOquery1.edit;在改变后
ADOquery1.post;这样就能提交数据库了。 而VS2008还需要编辑datarow等等很麻烦
大家有什么简便方法吗?
上面的Delphi 6的代码,VS2008 总不可能不支持吧~!
别告诉下星期出的VS2010 bate1才有这功能
Delphi不会,你绑定的没问题吧我是来抢沙发的