To import from an xlsx file to a Gridview, the whole code will be same as the post before, but the connection string should be changed.
It should be made: -
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" +
Server.MapPath("~/App_Data/Running.xlsx") + ";" + "Extended Properties=\"Excel 12.0;HDR=Yes\"");
Rest is same.
The code will run properly.
Now the challenge is to select the path of the file at runtime.
38 visitors
Google Brother Up
Subscribe to:
Post Comments (Atom)
Drop Down List
1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx
No comments:
Post a Comment