error while reading Excel sheet
- by Lalit
Hi,
I have code to read Excel from c3 language :
DataTable dtChildrenData = new DataTable();
OdbcConnection oConn = null;
try
{
if (File.Exists(strSheetPath))
{
oConn = new OdbcConnection();
oConn.ConnectionString = @"DSN=Excel Files;DBQ=" + strSheetPath + @";DriverId=1046;FIL=excel 12.0;MaxBufferSize=2048;PageTimeout=5;";
OdbcCommand oComm = new OdbcCommand();
oComm.Connection = oConn;
oComm.CommandText = "Select * From [Sheet1$]";
DataSet ds = new DataSet();
OdbcDataAdapter oAdapter = new OdbcDataAdapter(oComm);
oConn.Open();
oAdapter.Fill(ds);
dtChildrenData = ds.Tables[0];
}
}
finally
{
oConn.Close();
}
return dtChildrenData;
But getting this error when i deploy the web application on IIS. Wherere as it is running fine locally.
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
How to solve this. Please let me know if any information required to answer this question (about configuration)