关于数据库的问题
为什么我VB调用数据库无法更新物理数据库????
我把代码帖出来,大家帮我研究下吧,(另外updatecommand已在窗体代码在生成)Private Sub fbDiscard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.SqlDataAdapter1.Fill(Me.DataSet11.Booking)
mybind = Me.BindingContext(Me.DataSet11, "Booking")
mybind.AddNew()
Label2.Text = user
Label3.Text = a(2)
Label4.Text = shijian
Label5.Text = zhifu
Label6.Text = (b1 - b2) * number
Label7.Text = songhuo
Label8.Text = dizhi
Label19.Text = youbian
Label20.Text = dianhua
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
mybind.EndCurrentEdit()
Me.SqlDataAdapter1.Update(Me.DataSet11.Booking)
End Sub
参考答案:mybind.AddNew()
Label2.Text = user
Label3.Text = a(2)
Label4.Text = shijian
Label5.Text = zhifu
Label6.Text = (b1 - b2) * number
Label7.Text = songhuo
Label8.Text = dizhi
Label19.Text = youbian
Label20.Text = dianhua
mybind.UPDATE '缺少数据更新语句