c# - Cannot update. Database or object is read-only -


In my MVC3 razor project, I have uploaded an Excel sheet and saved it in my project folder. I need to read the values ​​inside superiority. To do this, I am just making wet banking. I can not update the "error. The database or the object is read only." While line DBC connection. open ();

Controller:

  performs string FP = "@" + session ["FilePathfinal"]. Toasting (); Datatelle fooData = new datatile (); OleDbConnection dbConnection = New OleDbConnection (@ "provider = Microsoft.Jet.OLEDB.4.0;" + @ "data source = '" + + fp + "';" + @ "extended property =" "excel 8.0;" ""); DbConnection.Open ();   

The FP file path is in the file path @ D: \ MVC \ Admin \ import.Admin \ App_Data \ ImportFileHome \ Baby needs.csv

This is the way to get out of this problem. Any help ???

Note: My Excel file is Excel 2013

Try the CSV :

  OleDbConnection conn = new OleDbConnection ("Provider = Microsoft.Jet.OleDb.4.0; Data Source =" + Path. GetDirectoryName (FileName) + "; Extended Properties = \" Text, HDR = Yes; FMT = delimited \ "");    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -