Operation must use an updateable query
-
Does anyone know what this error message means? Operation must use an updateable query It points to my ExecuteNonQuery() statement. Below are my code:
OleDbConnection oleDbConnection = new OleDbConnection(this.DatabaseConnectionString);
OleDbCommand oleDbCreateReservationCommand = oleDbConnection.CreateCommand();oleDbConnection.Open();
oleDbCreateReservationCommand.CommandText = "INSERT INTO Reservations (CustomerName, NumSeats, TimeReserved) VALUES ('" + nameCustomer + "', " + numSeatsToReserve.ToString() + ", '" + timeReservation + "')";oleDbCreateReservationCommand.ExecuteNonQuery();
oleDbConnection.Close();Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
-
Does anyone know what this error message means? Operation must use an updateable query It points to my ExecuteNonQuery() statement. Below are my code:
OleDbConnection oleDbConnection = new OleDbConnection(this.DatabaseConnectionString);
OleDbCommand oleDbCreateReservationCommand = oleDbConnection.CreateCommand();oleDbConnection.Open();
oleDbCreateReservationCommand.CommandText = "INSERT INTO Reservations (CustomerName, NumSeats, TimeReserved) VALUES ('" + nameCustomer + "', " + numSeatsToReserve.ToString() + ", '" + timeReservation + "')";oleDbCreateReservationCommand.ExecuteNonQuery();
oleDbConnection.Close();Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
http://support.microsoft.com/default.aspx?scid=kb;en-us;q175168[^] //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke
-
Does anyone know what this error message means? Operation must use an updateable query It points to my ExecuteNonQuery() statement. Below are my code:
OleDbConnection oleDbConnection = new OleDbConnection(this.DatabaseConnectionString);
OleDbCommand oleDbCreateReservationCommand = oleDbConnection.CreateCommand();oleDbConnection.Open();
oleDbCreateReservationCommand.CommandText = "INSERT INTO Reservations (CustomerName, NumSeats, TimeReserved) VALUES ('" + nameCustomer + "', " + numSeatsToReserve.ToString() + ", '" + timeReservation + "')";oleDbCreateReservationCommand.ExecuteNonQuery();
oleDbConnection.Close();Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
-
I have checked my database file but it isn't read only. Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
-
http://support.microsoft.com/default.aspx?scid=kb;en-us;q175168[^] //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke
I have checked the article but i am still unable to figure out the problem. In fact, my code is working fine before my computer was down, which i later reformatted everything and restored my application. Btw, is there any particular place to store database files? I noticed the server explorer in VS allows me to create a connection to my database, but i have no idea how to make use of the connection. :confused: Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
-
I have checked the article but i am still unable to figure out the problem. In fact, my code is working fine before my computer was down, which i later reformatted everything and restored my application. Btw, is there any particular place to store database files? I noticed the server explorer in VS allows me to create a connection to my database, but i have no idea how to make use of the connection. :confused: Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
Weiye Chen wrote: i later reformatted everything and restored my application Did you install framework before installing IIS. Weiye Chen wrote: is there any particular place to store database files Nothing specific as long as the user used by application has rights on the folder. Btw, did you give rights on the datafile file to IUSR_<> or ASPNET user or whichever user your application is using. Weiye Chen wrote: I noticed the server explorer in VS allows me to create a connection to my database, but i have no idea how to make use of the connection When you drag n drop tables from Server Explorer, it will automatically create objects of SqlDataAdapter and SqlCommand. You can test your sql operation using those objects. //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke
-
Weiye Chen wrote: i later reformatted everything and restored my application Did you install framework before installing IIS. Weiye Chen wrote: is there any particular place to store database files Nothing specific as long as the user used by application has rights on the folder. Btw, did you give rights on the datafile file to IUSR_<> or ASPNET user or whichever user your application is using. Weiye Chen wrote: I noticed the server explorer in VS allows me to create a connection to my database, but i have no idea how to make use of the connection When you drag n drop tables from Server Explorer, it will automatically create objects of SqlDataAdapter and SqlCommand. You can test your sql operation using those objects. //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke
Bee Master wrote: Did you install framework before installing IIS. Yes, i installed IIS after finishing setting up my Windows XP. Then i installed VS.NET. Bee Master wrote: Nothing specific as long as the user used by application has rights on the folder. Btw, did you give rights on the datafile file to IUSR_<> or ASPNET user or whichever user your application is using. I am using my account with administrator rights to run my application from VS.NET. So far, i didn't specify any rights to my database file or rather i didn't know how to do so. I used to just create my database file using Access and open it through my application. Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
-
http://support.microsoft.com/default.aspx?scid=kb;en-us;q175168[^] //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke
Anyway, thanks for you help. I just found out that the Internet Guest Account wasn't enabled. I got mixed up with the Windows Guest Account. I manage to find the correct account under Administrative Tools->Computer Management. :doh: Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
-
I have checked my database file but it isn't read only. Weiye Chen When pursuing your dreams, don't forget to enjoy your life...
I m facing the prob toooo.But not able to find the solution .How it makes database read only I don't know . This is Jitendra
-
I m facing the prob toooo.But not able to find the solution .How it makes database read only I don't know . This is Jitendra
Well, the cause of my problem is that the Internet Guest account isn't enabled. It is located under Administrative Tools->Computer Management of my Control Panel. (I am running on WindowsXP). Weiye Chen When pursuing your dreams, don't forget to enjoy your life...