日期:2014-05-17 浏览次数:20407 次
string connectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
string sql = "select [问题], [详细问题], [回答] from Content where ([问题] like'*" + content + "*') or ([详细问题] like'*" + content + "*') or ([回答] like'*" + content + "*')";
//string sql = "select * from Content";
connectionString += path;
OleDbConnection con = new OleDbConnection(connectionString);
con.Open();
OleDbDataAdapter ada = new OleDbDataAdapter(sql, con);
DataSet ds = new DataSet();
ada.Fill(ds, "Content");
DataTable dt = ds.Tables["Content"];
con.Close();
return dt;
string sql = "select * from Content";的时候,可以获取到DataTable
string sql = "select [问题], [详细问题], [回答] from Content where ([问题] like'*" + content + "*') or ([详细问题] like'*" + content + "*') or ([回答] like'*" + content + "*')";的时候,总是获取不到相关数据,但是我用这个查询语句去ACCESS里面去使用时我是能够查询出相关数据的,难道是因为数据量太大了?总共数据有32000多条。