sde
Well-known member
I dont know if it is me or not, but this always fails. Does this look correct?
Code:
string connString = @"Provider=Microsoft.Jet.OLEDB.4.0; User Id=; " +
@"Password=; Data Source=C:\test.xls; Extended Properties=Excel 8.0;";
OleDbConnection con = new OleDbConnection(connString);
if(con.State == ConnectionState.Open)
{
MessageBox.Show("Connection to Database Successful");
con.Close();
}
else
{
MessageBox.Show("connection to Database Failed");
}