日期:2014-05-16 浏览次数:20466 次
public void ExecuteSqlTran(string connectionString, Hashtable SQLStringlist)
{
using (SqlConnection con = new SqlConnection(connectionString))
{
con.Open();
using (SqlTransaction trans = con.BeginTransaction())
{
SqlCommand cmd = new SqlCommand();
try
{
foreach (DictionaryEntry myDY in SQLStringlist)
{
string cmdText = myDY.Key.ToString();
SqlParameter[] parameter = (SqlParameter[])myDY.Value;
PrepareCommand(cmd, con, trans, cmdText, parameter);
int result = cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
}
&nb