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

below Catch ex As Exception type this

msgbox (ex.Message)

Whats your problem, please specifies your problem and use code tax to post your code

datyabase connectivity code to connect from vb.net to Sql 2005

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.