日期:2014-05-17 浏览次数:21037 次
public OleDbDataReader ExecuteQueryReturnReader(string sql, string connStr)
{
OleDbConnection conn = new OleDbConnection();
OleDbDataReader reader = null;
try
{
conn = new OleDbConnection(connStr);
conn.Open();
OleDbCommand command = conn.CreateCommand();
command.CommandText = sql;
reader = command.ExecuteReader();
}
catch
{
}
finally
{
if (conn != null)
conn.Close();
}
return reader;
}
string DataBase = "HCConfig.mdb";
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ Application.StartupPath + "//" + DataBase;
ExecSql con = new ExecSql();