Last post Jul 03, 2013 08:08 AM by amlijupnandanan
Jul 03, 2013 07:41 AM|direct_tarun|LINK
I want to know the error code for primary key violation for mysql with c#. Earlier i was using -2147467259 erro code i have read somewhere that this error code is for primary key violation. But this error code is coming for every database exception. How
to detect primary key violation in catch.
Any help would be appreciated. Thank you
Jul 03, 2013 07:49 AM|mr.rahulmaurya|LINK
Check for primary key violation before database exception.
Jul 03, 2013 07:52 AM|direct_tarun|LINK
cant it be checked by error code... or by any specific exception???
Jul 03, 2013 08:08 AM|amlijupnandanan|LINK
You need to check that before execution of that qry..
SET @iCount=(SELECT COUNT * from table where id=@id)
EXECUE the query