zoukankan      html  css  js  c++  java
  • dbhelper

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data; using System.Data.SqlClient;

    namespace 第五章的实例

    {  class DBHelp    

    {         private SqlConnection con;         public SqlConnection Con        

    {             get           

      {                 string sql = "Data Source=.;

    Initial Catalog=MySchool;

    User ID=sa;Password=131479";                

    if (con == null)                

    {                     con = new SqlConnection(sql);

                    }                

    return con;            

    }         }         public void Open()        

    {             if (con.State == ConnectionState.Closed)            

    {                 con.Open();           

      }             else if (con.State == ConnectionState.Broken)          

       {                 con.Close();                 con.Open();          

       }         }         public void Close()       

      {             if (con.State == ConnectionState.Open || con.State == ConnectionState.Broken)        

         {                 con.Close();           

      }       

      }    

    } }

  • 相关阅读:
    数据泵使用笔记与相关shell
    手动创建数据库
    归档日志小试
    SQL语句的结果如何反映在SGA与磁盘中
    oracle 表空间
    linux 循环判断、数组、循环
    oracle 连接方式
    Changing Project Binding to Surround SCM Integration Provider with Visual Studio 2010
    On Caching and Evangelizing SQL
    Windows下使用python3 + selenium实现网页自动填表功能
  • 原文地址:https://www.cnblogs.com/s122/p/7826987.html
Copyright © 2011-2022 走看看