[求助]请求帮助解决DataGridView修改、删除、插入操作后不能更新到数据库
(vb.net 2005)我的代码如下:Dim con As New SqlClient.SqlConnection("Data Source=hzsctjz;Initial Catalog=t;Persist Security Info=True;User ID=sa;Password=")
con.Open()
Dim cmd As New SqlClient.SqlCommand("select * from tuser", con)
Dim adp As New SqlClient.SqlDataAdapter
Dim cb As New SqlClient.SqlCommandBuilder(adp)
adp.SelectCommand = cmd
Dim ds As New DataSet
adp.Fill(ds, "tuser")
'Me.DataGridView1.DataSource = ds
cb.GetUpdateCommand()
adp.Update(ds, "tuser")
con.Close()
ds = Nothing
adp = Nothing
DataGridView控件中的内容会改变,但是不会更新到数据库,我在网上都找了,但是都不对,请求帮忙,谢谢