asp.net|语句|执行
/// <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;
}
}