G
Guest
Need a good working example of reading Excel using ADO.NET. Here is what I
have but it does not work. The problem seems to be how to escape the quotes
in the Extended properties. Any suggestions appreciated.
StringBuilder sb = new StringBuilder();
string strConn = "";
sb.Append("Provider=Microsoft.Jet.OLEDB.4.0;");
sb.Append("DataSource=").Append(strFileName).Append(";").Append("Extended
Properties=");
sb.Append("\"").Append("\"").Append("Excel
8.0;").Append("HDR=Yes").Append("\"").Append("\"").Append("\"");
strConn = sb.ToString();
have but it does not work. The problem seems to be how to escape the quotes
in the Extended properties. Any suggestions appreciated.
StringBuilder sb = new StringBuilder();
string strConn = "";
sb.Append("Provider=Microsoft.Jet.OLEDB.4.0;");
sb.Append("DataSource=").Append(strFileName).Append(";").Append("Extended
Properties=");
sb.Append("\"").Append("\"").Append("Excel
8.0;").Append("HDR=Yes").Append("\"").Append("\"").Append("\"");
strConn = sb.ToString();