ทำไมผมบันทึกข้อมูลลงใน db access แล้วพอเปิด db ไม่มีข้อมูลอะไรเลย
Code (VB.NET)
Dim stru As String = TextBox1.Text
Dim strp As String = TextBox2.Text
Dim objconnection As OleDbConnection = Nothing
Dim objcmd As OleDbCommand = Nothing
Dim strSQL As String
Dim dbconn As OleDbConnection = Nothing
dbconn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\database\Database4.accdb;")
dbconn.Open()
strSQL = "insert into Member1 (username,[password]) values (?,?)"
objcmd = New OleDbCommand(strSQL, dbconn)
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("username", stru))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("password", strp))
dbconn.Close()
MsgBox("ok")