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++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -