当前位置: 首页 > news >正文

动物园网站建设的可行性分析网页制作背景图片设置

动物园网站建设的可行性分析,网页制作背景图片设置,前端电商网站登录界面怎么做,网站建设是设项目涉及到多个数据库的查询更新操作#xff0c;也就必然需要分布式事务的支持#xff0c;查了MSDN知道 .net 2.0 中利用新增的 System.Transactions 命名空间可以简单的实现分布式事务#xff1a; System.Transactions 基础结构通过支持在 SQL Server、ADO.NET、MSMQ 和 Mi…项目涉及到多个数据库的查询更新操作也就必然需要分布式事务的支持查了MSDN知道 .net 2.0 中利用新增的 System.Transactions 命名空间可以简单的实现分布式事务 System.Transactions 基础结构通过支持在 SQL Server、ADO.NET、MSMQ 和 Microsoft 分布式事务协调器 (MSDTC) 中启动的事务使事务编程在整个平台上变得简单和高效。它提供基于 Transaction 类的显式编程模型还提供使用 TransactionScope 类的隐式编程模型在这种模型中事务是由基础结构自动管理的。强烈建议使用更为方便的隐式模型进行开发。 具体参考http://msdn2.microsoft.com/zh-cn/library/system.transactions(VS.80).aspx 以及相关的连接都提供了非常详细的信息参考MSDN的Demo做了SQL Server 2000 的 使用事务范围实现隐式事务测试事务可以正常提交以及回滚private void Test1()    {        // 使用事务范围实现隐式事务        // ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.chs/dv_fxtransactions/html/1ddba95e-7587-48b2-8838-708c275e7199.htm        using (TransactionScope ts  new TransactionScope()) {            //Create and open the SQL connection.  The work done on this connection will be a part of the transaction created by the TransactionScope            SqlConnection myConnection  new SqlConnection(server(local);Integrated SecuritySSPI;databasenorthwind);            SqlCommand myCommand  new SqlCommand();            myConnection.Open();            myCommand.Connection  myConnection;            if (!chkGenError.Checked) {                //Restore database to near its original condition so sample will work correctly.                myCommand.CommandText  DELETE FROM Region WHERE (RegionID  100) OR (RegionID  101);                myCommand.ExecuteNonQuery();            }            //Insert the first record.            myCommand.CommandText  Insert into Region (RegionID, RegionDescription) VALUES (100, MidWestern);            myCommand.ExecuteNonQuery();            //Insert the second record.            myCommand.CommandText  Insert into Region (RegionID, RegionDescription) VALUES (101, MidEastern);            myCommand.ExecuteNonQuery();            myConnection.Close();            if (chkCommit.Checked) {                ts.Complete();            }            /**/////Call complete on the TransactionScope or not based on input            //ConsoleKeyInfo c;            //while (true) {            //    Console.Write(Complete the transaction scope? [Y|N] );            //    c  Console.ReadKey();            //    Console.WriteLine();            //    if ((c.KeyChar  Y) || (c.KeyChar  y)) {            //        // Commit the transaction            //        ts.Complete();            //        break;            //    }            //    else if ((c.KeyChar  N) || (c.KeyChar  n)) {            //        break;            //    }            //}        }    }    private void Test2()    {        string connectString1  server(local);Integrated SecuritySSPI;databasenorthwind;        string connectString2  server(local);Integrated SecuritySSPI;databasepubs;        string dt  DateTime.Now.ToString();        using (TransactionScope transScope  new TransactionScope()) {            using (SqlConnection connection1  new               SqlConnection(connectString1)) {                // Opening connection1 automatically enlists it in the                 // TransactionScope as a lightweight transaction.                connection1.Open();                // Do work in the first connection.                SqlCommand command1  new SqlCommand();                                command1.Connection  connection1;                //Restore database to near its original condition so sample will work correctly.                command1.CommandText  DELETE FROM Region WHERE (RegionID  100) OR (RegionID  101);                command1.ExecuteNonQuery();                //Insert the first record.                command1.CommandText  Insert into Region (RegionID, RegionDescription) VALUES (100, MidWestern);                command1.ExecuteNonQuery();                //Insert the second record.                command1.CommandText  Insert into Region (RegionID, RegionDescription) VALUES (101, MidEastern);                command1.ExecuteNonQuery();                // Assumes conditional logic in place where the second                // connection will only be opened as needed.                using (SqlConnection connection2  new                    SqlConnection(connectString2)) {                    // Open the second connection, which enlists the                     // second connection and promotes the transaction to                    // a full distributed transaction.                     connection2.Open();                                       // Do work in the second connection.                    SqlCommand command2  new SqlCommand();                                        command2.Connection  connection2;                    if (!chkGenError.Checked) {                        //Restore database to near its original condition so sample will work correctly.                        command2.CommandText  DELETE FROM stores WHERE (stor_id  9797) OR (stor_id  9798);                        command2.ExecuteNonQuery();                    }                    //Insert the first record.                    command2.CommandText  Insert into stores (stor_id, stor_name) VALUES (9797, ebay);                    command2.ExecuteNonQuery();                    //Insert the second record.                    command2.CommandText  Insert into stores (stor_id, stor_name) VALUES (9798, amazon);                    command2.ExecuteNonQuery();                                    }            }            //  The Complete method commits the transaction.            if (chkCommit.Checked) {                transScope.Complete();            }        }    }    private void Test3()    {        string connectString1  server(local);Integrated SecuritySSPI;databasenorthwind;        string connectString2  server(local);Integrated SecuritySSPI;databasepubs;        string dt  DateTime.Now.ToString();        using (TransactionScope transScope  new TransactionScope()) {            using (SqlConnection connection1  new               SqlConnection(connectString1)) {                // Opening connection1 automatically enlists it in the                 // TransactionScope as a lightweight transaction.                connection1.Open();                // Do work in the first connection.                SqlCommand command1  new SqlCommand();                command1.Connection  connection1;                //Restore database to near its original condition so sample will work correctly.                command1.CommandText  DELETE FROM Region WHERE (RegionID  100) OR (RegionID  101);                command1.ExecuteNonQuery();                //Insert the first record.                command1.CommandText  Insert into Region (RegionID, RegionDescription) VALUES (100, MidWestern);                command1.ExecuteNonQuery();                //Insert the second record.                command1.CommandText  Insert into Region (RegionID, RegionDescription) VALUES (101, MidEastern);                command1.ExecuteNonQuery();            }            // Assumes conditional logic in place where the second            // connection will only be opened as needed.            using (SqlConnection connection2  new                SqlConnection(connectString2)) {                // Open the second connection, which enlists the                 // second connection and promotes the transaction to                // a full distributed transaction.                 connection2.Open();                // Do work in the second connection.                SqlCommand command2  new SqlCommand();                command2.Connection  connection2;                if (!chkGenError.Checked) {                    //Restore database to near its original condition so sample will work correctly.                    command2.CommandText  DELETE FROM stores WHERE (stor_id  9797) OR (stor_id  9798);                    command2.ExecuteNonQuery();                }                //Insert the first record.                command2.CommandText  Insert into stores (stor_id, stor_name) VALUES (9797, ebay);                command2.ExecuteNonQuery();                //Insert the second record.                command2.CommandText  Insert into stores (stor_id, stor_name) VALUES (9798, amazon);                command2.ExecuteNonQuery();            }            //  The Complete method commits the transaction.            if (chkCommit.Checked) {                transScope.Complete();            }        }    }      测试的时候需要在 Sql Server 服务管理器中开启 MSDTC我是再 SQL 2k上做的测试2k5上应该得到更好的支持。方法 Test1() 是单数据库的事务只是为了测试 Test2()和Test3() 没有实质区别都是自动注册事务。完整代码下载/Files/Jinglecat/DTCSQL.rar同时我也尝试了一个Oracle版本Oracle 10g 2其中数据库orcl 是默认的启动数据库而数据库nhrs是我自己建的一个数据库测试通过代码跟SQL没有两样之前网上查到有网友说OracleClient还不支持 MSDTC查了很多资料确实在 ado.net 1.x 有问题现在可以确信 ado.net 2.0 已经可以支持。完整代码下载/Files/Jinglecat/DTCORA.rar现在银杏事务已经可以满数项目需求了有时间再多更多的研究了^_^ 转载于:https://www.cnblogs.com/Jinglecat/archive/2007/04/07/704297.html
http://www.pierceye.com/news/563587/

相关文章:

  • 自己做网站导航页腾讯云服务器可以做传奇网站吗
  • 郑州%公司 网站建设页面设计教案
  • 昌邑建设局网站北京seo优化wyhseo
  • 网站访客抓取新媒体营销课程心得体会
  • 网站建设售前域名注册
  • 运动器材网站开发方案失信被执行人名单查询系统
  • 深圳商业网站建设模板网站建设worldpress
  • 宁波网站排名网站开发 哪家好
  • 做网站的软件工程师网站积分程序怎么建设
  • ps网站轮播图怎么做动漫制作专业的来源
  • 怎么知道一个网站是谁做的建筑认证
  • 网站关键词优化排名公司网站备案的意思
  • 怎么把qq空间做成企业网站医疗网站设计
  • 个人博客网站需求分析上海最大企业前十名
  • 兴义之窗网站怎么做网页界面设计的类别
  • 黄南州网站建设公司安徽省建设厅执业资格注册中心网站
  • wordpress布置网站教程wordpress it模板下载地址
  • 网站首页栏目设置宿州建设网站公司哪家好
  • 西安网站建设怎么接单做社交的招聘网站
  • 实训课网站开发个人小结横岗做网站
  • 网站集约化建设管理方案wordpress加cnzz统计在那里加
  • 重庆知道推广网站方法青岛网络推广的有哪些公司
  • 自己做网站服务器要多少钱特殊字体
  • 网站建设合同 协议书网站建设工具有哪些
  • 网站建设的基本条件网站建设策划案怎么写
  • 知乎网站开发用的语言郑州建设网站哪家好
  • 企业官网建站费用长沙做无痛肠镜东大医院l网站
  • 建网站资料wordpress 读书模板
  • 网站建设初学者教程成华区微信网站建设公司
  • 沈阳网站建设-中国互联商城页面