Note that there are some explanatory texts on larger screens.

plurals
  1. POI am not able to read from Excel file and store into database using asp.net in c#?
    primarykey
    data
    text
    <p>I am doing this to read :</p> <pre><code>private bool writetoven(string xlspath) { OleDbConnection excelConnection = new OleDbConnection(excelConnectionString) try { OleDbCommand ocmd = new OleDbCommand("select * from [Sheet1$]", excelConnection); excelConnection.Open(); OleDbDataReader odr = ocmd.ExecuteReader(); string vcode = ""; string pswd = ""; string vname = ""; while (odr.Read()) { vcode = valid(odr, 0); pswd = valid(odr, 1); vname = valid(odr, 2); insertdataintosql(vcode,pswd,vname); } excelConnection.Close(); return true; } catch (DataException) { return false; } finally { lblmsg4.Text = "Data Inserted Sucessfully"; } } </code></pre> <p>and my connection string is like this:</p> <pre><code>excelConnectionString = "provider=Microsoft.jet.oledb.4.0;data source=" + filepath1 + ";extended properties='Excel 8.0;HDR=YES;'"; </code></pre> <p>but I am getting an error as</p> <blockquote> <p><em>The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.</em></p> <p><em>Line 1574: OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);<br> Line 1575:<br> Line 1576: excelConnection.Open();<br> Line 1577:<br> Line 1578:</em></p> </blockquote> <p>It seems like the file is still open but its not and I have checked the running process and its not there </p> <p>Now what should I do? ...My Excel sheet is closed but I am getting this error</p> <p>i dont have microsoft access on my com is that can be an issue </p> <p>is this problem is something to do with my fileupload control that i am using?? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload