How to get error code returned by query using MySQL in Asp.Net -


i working mysql in .net web app of mysql connector 5.0.9.0. getting data web service , inserting in local database. want insert unique rows in local database. came know when duplication occurs, mysql returned error code: 1062. want know how code in variable , check against condition like:

if(errorcode == "1062") {     response.write("record exists"); }  else {     // add record database } 

thanx in advance

have @ mysqlexception class members. there number property - gets number identifies type of error.

mysqlexception class.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -