Hi,
I have problem with my simple program. Actually, I try to store date value in form of date format (mm/dd/yyyy). I got message that inform me "number of query values and destination fields are not the same". I provide example coding below to help you all understand. Please help me, it urgent....
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oConn As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" & "C:\Documents and Settings\Crazy_Frog\My Documents\Visual Studio Projects\SportPlanet1\Data\spData.mdb")
Dim oApt As New OleDbDataAdapter("SELECT [tbl_name] FROM [database_name]", oConn)
Dim sql As String = String.Empty
Try
If _id = 0 Then
sql = "INSERT INTO [database_name] Values('" & TextBox4.Text & "')"
End If
oConn.Open()
Dim oComm As New OleDbCommand(sql, oConn)
oComm.ExecuteNonQuery()
oConn.Close()
MsgBox("Data Save.")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub