2
Answers

Cannot perform a shrinkdatabase operation inside transaction

While executing below-mentioned query in C# using Entity framework below-mentioned error occurred.Please find this.This query successfully executed in SQL server management studio.But not working on the C# code.Please, anyone, help me.
  1. var RunStoredProcedure1 = _context.Database.ExecuteSqlCommand("USE MDRFDataBase;  DBCC SHRINKDATABASE(N'MDRFDataBase' );  ");  
Cannot perform a shrink database operation inside a user transaction. Terminate the transaction and reissue the statement.
Answers (2)