Ive been trying to do the same.
I have 2 text boxes that i want to use to insert data to a database
DateID which i calculate with a datagrid total rows + 1
Date which will be the value i enter
When i press Submit, i wanna insert those values into the database, here is sample of my code
I get error on the SQLCONNECTION STRING. Keyword not supported: 'provider'. Im a rookie, please help.
Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\data.mdb ")
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "INSERT INTO Dates (DateID, Date) VALUES ('" + dateid.Text _
& "','" + actualdate.Text + "')"
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
|