数据库连接串的配置(2)

public struct ConnectionStrings
   {
       /// <summary>
       /// OLEDB标准连接
       /// </summary>
       public static string OLEDB = "Provider={0};Data Source={1};Initital Catalog={2};User ID={3};Password={4}";
       /// <summary>
       /// ODBC标准连接
       /// </summary>
       public static string ODBC = "Driver={{0}};Server={1};DataBase={2};Uid={3};Pwd={4}";
       /// <summary>
       /// 文件型数据库标准连接
       /// </summary>
       public static string AcessODBC = "Driver={{0}};Server={1};Dbq={2};Uid={3};Pwd={4}";
   
   }
   public class ConnectionString
   {
     
       /// <summary>
       /// 数据源,为空则默认本地
       /// </summary>
       public string DataSource { get; set; }
       /// <summary>
       /// 数据库名称
       /// </summary>
       public string Database { get; set; }
       /// <summary>
       /// 登录名
       /// </summary>
       public string UserID { get; set; }
       /// <summary>
       /// 登录密码
       /// </summary>
       public string Password { get; set; }
       /// <summary>
       /// 连接超时时间
       /// </summary>
       public string ConnectionTimeout { get; set; }
       /// <summary>
       /// 负载平衡超时
       /// </summary>
       public string ConnectionLifetime { get; set; }
       /// <summary>
       /// 池中允许的最大连接数
       /// </summary>
       public string MinPoolSize { get; set; }
       /// <summary>
       /// 池中允许的最大连接数
       /// </summary>
       public string MaxPoolSize { get; set; }
       /// <summary>
       /// 来与 SQL Server 的实例进行通信的网络数据包的大小,以字节为单位
       /// </summary>
       public string PacketSize { get; set; }
       /// <summary>
       /// 信任连接
       /// </summary>
       public string Trusted_Connection { get; set; }
       /// <summary>
       /// 当该值为 true 时,如果服务器端安装了证书
       /// 则 SQL Server 将对所有在客户端和服务器之间传送的数据使用 SSL 加密
       /// 可识别的值为 true、false、yes 和 no
       /// </summary>
       public string Encrypt { get; set; }
       /// <summary>
       /// 用于建立与 SQL Server 实例的连接的网络库
       /// </summary>
       public string NetworkLibrary { get; set; }
       /// <summary>
       /// 数据库版本
       /// </summary>
       public string TypeSystemVersion { get; set; }
   }
   public struct DbProvider
   {

       public static string SQLServerProvider = "SQLOLEDB";
       public static string AcessProvider = "Microsoft.Jet.OleDb.4.0";
       public static string ExcelProvider = "Microsoft.Jet.OLEDB.4.0";
       public static string TextProvider = "Microsoft.Jet.OLEDB.4.0";
       public static string OracleProvider = "MSDAORA";
       public static string MySQLProvider = "MySQLProv";
       public static string IBMDB2Provider = "DB2OLEDB";
       public static string SIBProvider = "SIBPROVIDER";
       public static string AdaptiveServerAnywhereProvider = "ASAProv";
       public static string AdaptiveServerEnterpriseProvider = "Sybase ASE OLE DB Provider";
       public static string VisualFoxproProvider = "vfpoledb";
   }
   public struct DbDriver
   {
       public static string SQLServerDriver = "SQL Server";
       public static string AccessDriver = "Microsoft Access Driver (*.mdb)";
       public static string ExcelDriver = "Microsoft Excel Driver (*.xls)";
       public static string TextDriver = "Microsoft Text Driver (*.txt; *.csv)";
       public static string OracleDriver = "Microsoft ODBC for Oracle";
       public static string MySQLDriver = "MySQL ODBC 3.51 Driver|mySQL";//??
       public static string InterBaseDriver = "Easysoft IB6 ODBC";
       public static string IntersolvDriver = "INTERSOLV InterBase ODBC Driver (*.gdb)";
       public static string Intersolv310 = "INTERSOLV 3.10 32-BIT Sybase";
       public static string AS400Driver = "Client Access ODBC Driver (32-bit)";
       public static string Sybase12Driver = "SYBASE ASE ODBC Driver";
       public static string Sybase11Driver = "SYBASE SYSTEM 11";
       public static string SybaseSQLAnywhereDriver = "Sybase SQL Anywhere 5.0";
       public static string VisualFoxProdBASEDriver = "Microsoft dBASE Driver (*.dbf)";
       public static string VisualFoxproDriver = "Microsoft Visual Foxpro Driver";
   
   }
  
}

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。