title: How to execute Bulk Insert Stored Procedure inside Controller
body: <p>i have written a stored procedure for bulk insert like this: </p>
  
  <pre><code>USE [BRDCEP_MIS]
  GO
  
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  create proc dbo.SP_BulkInsertPsc
  as
  begin
  BULK INSERT BrdcepPscData 
  FROM  'E:\BRDCEP_MIS\BRDCEP_MIS\App_Data\PSC\NRSP.csv'
  WITH 
  ( 
       FIRSTROW = 2 ,
      FIELDTERMINATOR = ',', 
      ROWTERMINATOR = '\n' 
  )
  end
  GO
  </code></pre>
  
  <p>and i want to execute this SP when i call the specific function in the controller it shows no error but also it is not adding data into the database . my controller function is this: </p>
  
  <pre><code>[HttpGet]
  public ActionResult ImportPSCData()
  {
      using (ApplicationDbContext db = new ApplicationDbContext())
      {
          db.Database.ExecuteSqlCommand("TRUNCATE TABLE BrdcepPscData");
          var a = db.Database.SqlQuery&lt;int&gt;("Sp_BulkInsertPsc");
      }
  
      return View();
  }
  </code></pre>
  
  <p>can anybody please tell me what i am doing wrong?</p>