Datacontext entity framework truncate table


We can truncate table in the Datacontext entity framework by the below code

   var objCtx = ((System.Data.Entity.Infrastructure.IObjectContextAdapter)objentity).ObjectContext;
                    objCtx.ExecuteStoreCommand("TRUNCATE TABLE [Table]");



0 comments:

Post a Comment

Vikram Chandra Theme by BloggerThemes & NewWPThemes Sponsored by iBlogtoBlog