I am using ASP.NET with MS.Access In databse.. there is table called login with three fields i.e. id, username, password. following is the code which i am trying to run.
try this
String username = TextBox1.Text;
String password = TextBox2.Text;
OleDbConnection dbConnection = new OleDbConnection("provider=microsoft.ACE.OLEDB.12.0; Data source=C:\\Users\\Mohit Kumar Singla\\Documents\\phonebook.accdb");
dbConnection.Open();
Console.WriteLine("Error Occurred. Please check");
System.Diagnostics.Debug.WriteLine("Error--------------------------------");
String q = "insert into login (username, [password]) values (@u, @p)";
OleDbCommand cmd = new OleDbCommand(q, dbConnection);
cmd.Parameters.AddWithValue("@u", username);
cmd.Parameters.AddWithValue("@p", password);
cmd.ExecuteNonQuery();
dbConnection.Close();