Connection Strings to Read XLS And XLSX And CSV File In C#,ASP.NET
To Upload CSV File:
string CSVconnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strPathofFileCsv + @";Extended Properties='text;HDR=Yes;FMT=Delimited(,)';";To Upload XLS File:
string XLSconnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= " + strPathofFileXls + ";Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\"";
To Upload XLSX File:
string XLSXconnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strPathofFileXlsx + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\";";
No comments:
Post a Comment