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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -