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