C# .NET - UPDATE query in ASP NET - Asked By Ryan Naef on 30-Jan-05 11:03 PM

I am trying to update a db from an asp.net page and it keeps giving a 'System.Data.OleDb.OleDbException: Operation must use an updateable query.' error. works fine with a simple SELECT query. The UPDATE query works fine in the db itself. 

			string strConnection1;
			strConnection1 = "Provider=Microsoft.Jet.OleDb.4.0;";
			strConnection1 += @"Data Source=C:\Inetpub\wwwroot\Estimator2\Estimator.mdb";

			string s = 
				"UPDATE Sales SET Sales_Person =/"Jon Doe/", Sales_Phone = /"555/" WHERE Sales_Number = 1;";	
objConnection = new OleDbConnection(strConnection1);
			OleDbCommand myCommand = new OleDbCommand(s, objConnection);
				myCommand.Connection.Open();
				Label1.Text = myCommand.ExecuteNonQuery().ToString();
				objConnection.Close();

Thanks for any help!

Write Permission problem - Asked By Ali INAL on 31-Jan-05 07:00 AM

Hi Ryan,

Please be sure that, aspnet user has enough rights to write to .mdb file's folder. This is required to perform update/insert/delete action on any mdb database.

Hope this helps...
@li