⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program.cs

📁 < SQL Server2005程序设计>
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Transactions;
using System.Data;
using System.Data.SqlClient;
using TheRM;

namespace BigBang
{
    class Program
    {
        static void Main(string[] args)
        {
            string connStr = "Data Source=(local);Initial Catalog=Test;user id=sahil;password=sahil";
            string cmdText = "InsertRow";

            VolatileRM vrm = new VolatileRM("RM1");
            Console.WriteLine("Member Value:" + vrm.MemberValue);

            using (TransactionScope tsc = new TransactionScope())
            {
                using (SqlConnection conn1 = new SqlConnection(connStr))
                {
                    SqlCommand cmd1 = conn1.CreateCommand();
                    cmd1.CommandText = cmdText;
                    cmd1.CommandType = CommandType.StoredProcedure;
                    conn1.Open();
                    cmd1.ExecuteNonQuery();
                }

                vrm.MemberValue = 3;

                tsc.Complete();
            }

            Console.WriteLine("Member Value:" + vrm.MemberValue);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -