下面这段代码怎么不能把更改后的数据表的数据返回给sql数据库啊! Dim con As New SqlConnection(myconstr)
Dim com As New SqlCommand("select * from caip69last order by n1", con)
Dim myada As New SqlDataAdapter(com)
Dim custCB As SqlCommandBuilder = New SqlCommandBuilder(myada)
con.Open()
Dim myT69 As New DataSet
myada.Fill(myT69) ' Code to modify data in DataSet here myada.Update(myT69)
con.Close()
Dim com As New SqlCommand("select * from caip69last order by n1", con)
Dim myada As New SqlDataAdapter(com)
Dim custCB As SqlCommandBuilder = New SqlCommandBuilder(myada)
con.Open()
Dim myT69 As New DataSet
myada.Fill(myT69) ' Code to modify data in DataSet here myada.Update(myT69)
con.Close()
不行啊,上面有这一句,把它放下来后也不行啊Dim custCB As SqlCommandBuilder = New SqlCommandBuilder(myada)
似乎和主键无关,你这是select
现在都用微软企业库了。
Update方法,只要一句话就行了。