Update 无法找到 TableMapping['Table'] 或 DataTable Table 。
源码如下:PrivateSubForm1_Load(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMyBase....
源码如下:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
con = New SqlConnection
con.ConnectionString = constr
Try
con.Open()
Catch ex As Exception
MessageBox.Show("数据库连接失败", "提示")
End Try
sqlstr = "select * from student_info"
dadpt = New SqlDataAdapter(sqlstr, con)
dadpt.Fill(ds, "student_info")
DataGrid1.DataSource = ds
ds.AcceptChanges()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dss As New DataSet
con = New SqlConnection
con.ConnectionString = constr
Try
con.Open()
Catch ex As Exception
MessageBox.Show("数据库连接失败", "提示")
End Try
sqlstr = "select * from student_info"
dadpt = New SqlDataAdapter(sqlstr, con)
dadpt.Update(ds.GetChanges)
End Sub
在更新的时候就会出现上面的问题,请哪位大侠指点迷津啊!!!! 展开
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
con = New SqlConnection
con.ConnectionString = constr
Try
con.Open()
Catch ex As Exception
MessageBox.Show("数据库连接失败", "提示")
End Try
sqlstr = "select * from student_info"
dadpt = New SqlDataAdapter(sqlstr, con)
dadpt.Fill(ds, "student_info")
DataGrid1.DataSource = ds
ds.AcceptChanges()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dss As New DataSet
con = New SqlConnection
con.ConnectionString = constr
Try
con.Open()
Catch ex As Exception
MessageBox.Show("数据库连接失败", "提示")
End Try
sqlstr = "select * from student_info"
dadpt = New SqlDataAdapter(sqlstr, con)
dadpt.Update(ds.GetChanges)
End Sub
在更新的时候就会出现上面的问题,请哪位大侠指点迷津啊!!!! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询