0

the path is correct, and there is no error, but still, my database is empty...


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Along\Documents\Visual Studio 2008\Projects\LCRS\LCRS\Lcrsd.mdb;")
Dim myCommand As OleDbCommand
Dim mySQLString As String
Try
myConnection.Open()
mySQLString = "INSERT INTO REKOD_PELAJAR VALUES('" + TextBox1.Text + "','" + ComboBox1.Text + " ','" + DTP.Value + "','" + TextBox2.Text + "')"
myCommand = New OleDbCommand(mySQLString, myConnection)
myCommand.CommandType = CommandType.Text
myCommand.ExecuteNonQuery()
Catch ex As Exception

Finally
myConnection.Close()
End Try
MessageBox.Show("rekod anda telah disimpan")

End Sub

End Class

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by deepakmjoshi
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.