c# - Access DB - operation must use an updateable query -


i have table need update user's password username store in session. however, got error: "operation must use updateable query" though have granted users , administrators full control.

the following codes:

string str = @"provider=microsoft.ace.oledb.12.0;data source=c:\inetpub\wwwroot\myfolder\mydatabase"; using (oledbconnection con = new oledbconnection(str)) using (oledbcommand cmd = con.createcommand()) {     cmd.commandtext = "update [users] set [password] = ? username = ?";     cmd.parameters.add("password", oledbtype.varchar).value = request.form["conpassword"];     cmd.parameters.add("username", oledbtype.varchar).value = (string)session["username"];     con.open();     try     {          cmd.executenonquery();          messagebox.show("your password has been changed successfully.");     }     catch (exception ex)     {          response.write(ex.message);     }         {          con.close();     } } 


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -