c# - Update query for Access Database for certain Parameters -


I am using MS Access as a database and to update some records in it, c #, .net I am using But this is making a mistake in saying:

"No value has been given for one or more essential standards."

The table has 5 columns and I want to update only 2, I have it for

  "User_DRL set user_role_id = '" + _UserRole + "', Auth_id = '"+ _authId +"' "+" WHERE id = '"+ _Id +"' ";  

Where _UserRole, _authId, _Id is the string

What could be the error. Do I need to give every parameter in the update parameter or any other way.

Thanks

Whenever you get such an error, be a breakpoint and Test your query to ensure that you expect. For example, a useror actually exists in the _authId and _Id query.

You can add some defensive code before preparing the statement - this example checks to ensure that _UserRole is empty or empty.

  if (string! I.e.n.l.l.a. (_UserRole)) {...  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -