/// <summary>
/// 执行sql语句(事务)
/// </summary>
///
public bool cmdsql(string[] str)
{
getoconn();
mytrans =oconn.begintransaction();
ocmd=new oledbcommand();
ocmd.connection=oconn;
ocmd.transaction=mytrans;
try
{
for(int i=0;i<str.length;i++)
{
ocmd.commandtext=str[i];
ocmd.executenonquery();
}
mytrans.commit();
closeoconn();
return true;
}
catch
{
mytrans.rollback();
return false;
}
}
新闻热点
疑难解答
图片精选