Insert data into MS-Access in VB.net
This is an example which is best and very simple for inserting to an MS Access database.
1. First of all add a textbox and button.
2. Add these namespaces into the program before the start of the class
3. Declare these variables in the form
Dim conn As OleDb.OleDbConnection
Dim cmd As OleDb.OleDbCommand
4. Add these on the button click event
cmd = New OleDb.OleDbCommand("insert into Table1 values(' " + TextBox1.Text + " ')", conn)
add this form load
Dim con As String = "Provider=Microsoft.JET.oledb.4.0;Data Source=H:\SPM\name.mdb"
conn = New OleDb.OleDbConnection(con)
NOTE:Please dont forget to change database name and table name as per ur table.
thanx... its rally working with these short codes... thanx a lot...
thanks its a very good help for the begginer level, application developer thanks a lot
it is just correct