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();
                }

            }


        private const string SQL_INSERT
                            = @"
                                INSERT INTO
                                    dataTableName
                                    (OUTPUT_DATE_F,
                                    OUTPUT_DATE_L)
                                VALUES
                                    (@OUTPUT_DATE_F,
                                    @OUTPUT_DATE_L)
                                    ";

posted on 2008-12-29 14:40  AlexusLi  阅读(207)  评论(0编辑  收藏  举报