Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# read char 
Csharp :: loop over all values in enum 
Csharp :: stop flickering 
Csharp :: unity remove parent 
Csharp :: c# tryparse int 
Csharp :: how to add reference to rigidbody 2d 
Csharp :: net use delete 
Csharp :: c# read from file 
Csharp :: what is data encapsulation c# 
Csharp :: c sharp array to list 
Csharp :: prettier inst working c# 
Csharp :: change vignette intensity unity 
Csharp :: c# linq to dictionary 
Csharp :: get text component unity 
Csharp :: how to pause physics in unity c# 
Csharp :: c# inline a function 
Csharp :: content type application/json c# 
Csharp :: how to make a enum list in c# 
Csharp :: unity random 
Csharp :: how to move towards an object unity 
Csharp :: c sharp list length 
Csharp :: dropdown wpf 
Csharp :: call stored proc c# 
Csharp :: c# skip following code in loop 
Csharp :: c# foreach dictionary 
Csharp :: how to change the axis of a Vector3 variable 
Csharp :: cannot convert from string to type T 
Csharp :: c# textbox numbers only 
Csharp :: how to add a variable in unity c# 
Csharp :: distinct prime factors count of a number 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =