Aditya
New member
- Joined
- Jul 22, 2006
- Messages
- 4
- Programming Experience
- 3-5
I'm facing a problem in inserting data from textboxes into an access database. All my coding is according to book and no error is there still at run time it throws exception and doesn't enter data. I haven't done it through coding i've picked everything from data tab in toolbox. .NET has its self generated code for that i've just added following lines. I need help quickly. Following is the code:
Dim query As String
query = Me.OleDbInsertCommand1.CommandText
Dim cmd As New OleDb.OleDbCommand(query, OleDbConnection1)
OleDbConnection1.Open()
cmd.ExecuteNonQuery() 'This command will insert the data.
MsgBox("Data Entered Successfully")
OleDbConnection1.Close()
Dim query As String
query = Me.OleDbInsertCommand1.CommandText
Dim cmd As New OleDb.OleDbCommand(query, OleDbConnection1)
OleDbConnection1.Open()
cmd.ExecuteNonQuery() 'This command will insert the data.
MsgBox("Data Entered Successfully")
OleDbConnection1.Close()