Hi
ON below line i get above error
string m_DocNo = dr[0].ToString();
void Upload_InternetData()
{
OleDbConnection connection = new OleDbConnection();
try
{
string path = Server.MapPath("~") + "/UpLoad/Data.xls";
string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";";
connection.ConnectionString = excelConnectionString;
OleDbCommand command = new OleDbCommand("select * from [Sheet1$]", connection);
connection.Open();
DbDataReader dr = command.ExecuteReader();
if (dr.HasRows)
{
string m_DocNo = dr[0].ToString();
}
dr.Close();
}
catch (Exception ex)
{
}
}Thanks