HOW 2 USE SERVER.MAPTH FOR CONNECTION STRINGS

Posted by Parthibansk under ASP.NET on 3/12/2013 | Points: 10 | Views : 584 | Status : [Member] | Replies : 1
I HAVE TO INSERT DATA TO EXCEL FILE WHICH IS PLACED IN MY APP DIRECTORY..

HOW TO USE SERVER.MAPPATH FOR THE BELOW..

BELOW IS MY CONNECTION STRING:

string con = "PROVIDER=Microsoft.ACE.OLEDB.12.0;Data Source= D:\\USERS\\joinees.xlsx;Extended Properties='Excel 12.0 xml;hdr=yes'";




Responses

Posted by: Jayakumars on: 3/12/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

use this code

oConn = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source =D:\\USERS\\joinees.xlsx; Extended Properties = ""Text;HDR=YES;FMT=Delimited"";")

Mark as Answer if its helpful to you

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response