Joe Wilson

Joe Wilson

  • NA
  • 7.8k
  • 418.2k

What is the problem in connection string of my program?

Jun 16 2014 7:40 AM
What is the problem of connection string that can not connect to the access database please,Guide me.
 
 
 
 
 
 
public DataTable ShowData(string s1)
{
OleDbConnection CN = new OleDbConnection();
CN.ConnectionString = "provider = microsoft.Ace.oledb.12.0; Data source = D:\\Database 10.accdb";
CN.Open();

OleDbCommand CMT = new OleDbCommand(s1, CN);
OleDbDataReader da = CMT.ExecuteReader();

DataTable DT = new DataTable();
DT.Load(da);
CN.Close();
return DT;
}

 

Answers (8)