大家帮忙看看这个更新怎么不行呢!!谢谢
Private typeds As New DataSet Dim mycon As New OleDbConnection Dim mydata As New OleDbDataAdapter
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load mycon.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=db1.mdb" mydata = New OleDbDataAdapter("select * from xmmc", mycon) mycon.Open() mydata.Fill(typeds) DataGrid1.DataSource = typeds.Tables(0) mycon.Close() End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click mydata = New OleDbDataAdapter("select * from xmmc", mycon) mydata.Update(typeds) End Sub 我修改DataGrid1,内容,按button2更新,提示需要有效的updatecommand?是怎么回事?数据库有主键,我刚学,谢谢大家!