连接到数据库后用
Command.CommandText ="Inssert Into (Tbale1) value ('Value1')"
等语句后数据库里没有新增内容,删除也一样,不知道是不是还需要什么操作或者哪里错了.
源代码:
Private Sub tst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tst.Click
Dim AConnect As OleDb.OleDbConnection
Dim ACmd As OleDb.OleDbCommand
Dim ConnectStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\Enroll.mdb"
Dim AFind As String = "insert into rj (编号) value ('1000')"
AConnect = New OleDb.OleDbConnection(ConnectStr)
AConnect.Open()
ACmd = New OleDb.OleDbCommand(AFind, AConnect)
ACmd.CommandText = AFind
AConnect.Close()
End Sub
对数据库的查询返回结果怎么写,如果需要把相关值返回到DataGridView里或者其它的控件中。