c# sql duplicate key exception
try
{
// Try to insert
}
catch (SqlException exception)
{
if (exception.Number == 2601) // Cannot insert duplicate key row in object error
{
// Handle duplicate key error
return;
}
else
throw; // Throw exception if this exception is unexpected
}
Also in C#:
- unity vector3 to array
- convert array object to int[] c#
- degree to radians c#
- get string character by index c#
- instantiate object in circle
- matplotlib measure the width of text
- gfortran: declare an array
- unity simple fps controller
- how to change scenes in unity
- c# how to add newline on text box
- winforms c# add data to datagridview with a button
- asp.net core task iactionresult
- c# changimg to one decimal place
- constructor in inherited class c#
- c# find comma in text and remove
- c# check to see if dictionary key exists
- array copy c#
- c# inheritance constructor
- c# loop through array
- c# return multiple value unity
- c# loop through object
- define a vector c#
- make a list c#
- c# get index of item in list