using (SqlConnection cn = DfwSql.GetOpenConnection())
{
using (SqlTransaction tx = cn.BeginTransaction(IsolationLevel.ReadCommitted))
{
using (DfwSqlCommand cmd = new DfwSqlCommand(SQL_INSERT, cn, tx))
{
cmd.Parameters.Add("@dateBefore", SqlDbType.Char, 2).Value = dateBefore;
cmd.Parameters.Add("@dateLast", SqlDbType.Char, 2).Value = dateLast;
}
tx.Commit();
}
{
using (SqlTransaction tx = cn.BeginTransaction(IsolationLevel.ReadCommitted))
{
using (DfwSqlCommand cmd = new DfwSqlCommand(SQL_INSERT, cn, tx))
{
cmd.Parameters.Add("@dateBefore", SqlDbType.Char, 2).Value = dateBefore;
cmd.Parameters.Add("@dateLast", SqlDbType.Char, 2).Value = dateLast;
}
tx.Commit();
}
}
private const string SQL_INSERT
= @"
INSERT INTO
dataTableName
(OUTPUT_DATE_F,
OUTPUT_DATE_L)
VALUES
(@OUTPUT_DATE_F,
@OUTPUT_DATE_L)
";
梦想与现实的落差,就是我们离成功的距离~