日期:2014-05-17 浏览次数:20813 次
OleDbConnection conn;
OleDbDataReader reader;
/// <summary>
/// 打开数据连接
/// </summary>
/// <param name="sql">数据库连接语句</param>
public void open(String sql)
{
conn = new OleDbConnection(sql);
conn.Open();
}
public bool sql(String sql)
{
OleDbCommand comm = new OleDbCommand();
comm.CommandText = sql;
comm.Connection = conn;
reader=comm.ExecuteReader();
rd = reader.Read();
reader.Close();
return rd;
}
public void inquire(Object text)
{
object lockojb = new object();
//lock锁
lock (lockojb)
{
//去掉条形码ID的条码号
// da.open(Class1.strconn);