- Joined
- Jun 1, 2009
- Messages
- 1
- Reaction score
- 0
public void storecounter(int counter)
{
System.AppDomain.CurrentDomain.BaseDirectory.ToString();
string p;
string relativepath = @"~/counter.mdb";
string vount = counter.ToString();
AccessDataSource da = new AccessDataSource();
da.AppRelativeTemplateSourceDirectory = "~/counter.mdb";
p = System.IO.Path.GetFileName("~/counter.mdb");
da.DataFile = "~//counter.mdb";
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" + Server.MapPath("~/App_Code/counter.mdb") + "");
con.Open();
OleDbCommand cmd = new OleDbCommand("INSERT INTO [counter] values(@counter)", con);
cmd.Parameters.AddWithValue("@counter", counter);
cmd.ExecuteNonQuery(); <---------- HEre is give on error
cmd.Dispose();
con.Close();
}
I am Ram Kumar a beginer programmer. i have host a website on net. when i filling the form for testing purpose. it gives an error operation must use an updateable query. my database in access.
Please Solve this Error Ugrently.
Please
Please
any one help me
{
System.AppDomain.CurrentDomain.BaseDirectory.ToString();
string p;
string relativepath = @"~/counter.mdb";
string vount = counter.ToString();
AccessDataSource da = new AccessDataSource();
da.AppRelativeTemplateSourceDirectory = "~/counter.mdb";
p = System.IO.Path.GetFileName("~/counter.mdb");
da.DataFile = "~//counter.mdb";
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" + Server.MapPath("~/App_Code/counter.mdb") + "");
con.Open();
OleDbCommand cmd = new OleDbCommand("INSERT INTO [counter] values(@counter)", con);
cmd.Parameters.AddWithValue("@counter", counter);
cmd.ExecuteNonQuery(); <---------- HEre is give on error
cmd.Dispose();
con.Close();
}
I am Ram Kumar a beginer programmer. i have host a website on net. when i filling the form for testing purpose. it gives an error operation must use an updateable query. my database in access.
Please Solve this Error Ugrently.
Please
Please
any one help me