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

      }       

      }    

    } }

  • 相关阅读:
    luogu P3327 [SDOI2015]约数个数和
    生成函数
    luogu P4318 完全平方数
    SP5971 LCMSUM
    luogu P2522 [HAOI2011]Problem b
    UOJ #82. 【UR #7】水题生成器
    CF1147F Zigzag Game
    CF1106F Lunar New Year and a Recursive Sequence
    1114: 逆序
    1113: 递归调用的次数统计(函数专题)
  • 原文地址:https://www.cnblogs.com/s122/p/7826987.html
Copyright © 2011-2022 走看看