Hello Friends I am using Microsoft Visual Studio 2005 and ms-acess 2000 to build very simple database application
Here is my Code of Conncetion:

con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mdb")
        sql = "INSERT INTO emp values(@op1,@op2)"
        cmd = New OleDbCommand(sql, con)
        cmd.Parameters.AddWithValue("@op1", TextBox1.Text)
        cmd.Parameters.AddWithValue("@op2", TextBox2.Text)
        con.Open()
        cmd.ExecuteNonQuery()
        con.Close()

This is simple code to insert data from textbox to table row
But Whenever i run it did not give me error but when i check on database the record is not there.
What should i do?????
Please Guys Help Me Out.
thanks in advance..

Select the .mdb file in solution explorer and set Copy To Output Directory=Copy if Newer file property from the properties window.

Select the .mdb file in solution explorer and set Copy To Output Directory=Copy if Newer file property from the properties window.

Thank Tou!!!!!!

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.