0

Possible Duplicate:
System.Data.OleDb.OleDbException: Invalid internet address. How do you connect to excel files located on a webserver using OleDb

I have a uploaded an excel file in a server. http :// mysite.com/docs/excelFile.xlsx". I need to read this excel file by establishing oledb connection without having to save the file to disk. Any idea? the below code give "invalid internet address error". How can i create the connection string for the file located in a server?

String connectionString = String.Empty;
connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;
Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""", 
"http://mysite.com/docs/excelFile.xlsx");
Community
  • 1
  • 1
sharmila
  • 1,493
  • 5
  • 23
  • 42
  • Is it maybe the space in your web address : Try `http://mysite.com/docs/excelFile.xls` ? Not sure if OLEDB allows you to connect data source on the web. – gideon Jan 30 '13 at 08:40
  • No. the web address in correct. is there a way to establish a connection to file located in a server? – sharmila Jan 30 '13 at 08:43
  • See similar question: http://stackoverflow.com/questions/226524/system-data-oledb-oledbexception-invalid-internet-address-how-do-you-connect-t?rq=1 Short: it's not possible – DarkWanderer Jan 30 '13 at 08:45

1 Answers1

0

The file upload control will give you a stream to the file. You can use this method to parse the data out of the csv

http://www.knowdotnet.com/articles/creatingandparsingcsvfiles.html

Diggie
  • 142
  • 3
  • 10