Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

.Net Entity Framework Reseed SQL Server Table ID Column

public void ResetId()
    {
         try
        {
            using (DaghanKantarEntities context = new DaghanKantarEntities())
            {
                context.Database.ExecuteSqlCommand("DELETE FROM dbo.tbl_MainWeight");
                context.Database.ExecuteSqlCommand("DBCC CHECKIDENT ('tbl_MainWeight', RESEED, 0)");
                context.SaveChanges();

            }
        }
        catch (Exception exp)
        {
            throw new Exception("Hata: Kayıt Resetlenemedi - " + exp.Message.ToString(), exp);
        }

    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to remove a parten transform unity 
Csharp :: expander vertical wpf 
Csharp :: How to enumerate an enum 
Csharp :: unity customize hierarchy window 
Csharp :: asp net identity login failed for user 
Csharp :: string to float c# 
Csharp :: unity convert pixels to units 
Csharp :: c# get Full Exception message if InnerException is not NULL 
Csharp :: c# string is all zeros 
Csharp :: chaine de connexion sql server c# 
Csharp :: Unity search all chidren of parent object 
Csharp :: unfreeze position in unity 
Csharp :: mock return exception c# 
Csharp :: touch screen to world point 
Csharp :: satisfactory controller support 
Csharp :: c# lambda get all records async 
Csharp :: replace bar c# 
Csharp :: c# control datagridview null value 
Csharp :: C:UsersSherryDocumentssdata.dta 
Csharp :: split nullable in c# 
Csharp :: how to center a window in monogame 
Csharp :: C# Payroll 
Csharp :: c# printwindow chrome 
Csharp :: spring jar debug level running 
Csharp :: leave two decimal in double c# 
Csharp :: Set orientation of moving object towards it movement direction 
Csharp :: c# dictionary contain key but returns false 
Csharp :: null objects 
Csharp :: secret 
Csharp :: wetter warendorf 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =