摘抄的SQL Server和Access的ConnectionString

博客介绍了SQL Server和Access数据库的多种连接方式,包括ODBC、OLE DB等。对于SQL Server,有标准安全、可信连接、提示输入用户名和密码等连接方式;对于Access,也有标准安全、工作组、独占等不同连接设置。

 SQL Server

    •  ODBC

      •  Standard Security:
        "Driver={SQL Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;"


      •  Trusted connection:
        "Driver={SQL Server};Server=Aron1;Database=pubs;Trusted_Connection=yes;"


      •  Prompt for username and password:
        oConn.Properties("Prompt") = adPromptAlways
        oConn.Open "Driver={SQL Server};Server=Aron1;DataBase=pubs;"

       

    •  OLE DB, OleDbConnection (.NET)


    •  Standard Security:
      "Driver={SQL Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;"


    •  Trusted connection:
      "Driver={SQL Server};Server=Aron1;Database=pubs;Trusted_Connection=yes;"


    •  Prompt for username and password:
      oConn.Properties("Prompt") = adPromptAlways
      oConn.Open "Driver={SQL Server};Server=Aron1;DataBase=pubs;"




    •  Standard Security:
      "Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"


    •  Trusted Connection:
      "Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
      (use serverName/instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
    •  Prompt for username and password:
      oConn.Provider = "sqloledb"
      oConn.Properties("Prompt") = adPromptAlways
      oConn.Open "Data Source=Aron1;Initial Catalog=pubs;"


    •  Connect via an IP address:
      "Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
      (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))


 SqlConnection (.NET)

  •  Standard Security:
    "Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
       - or -
    "Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
       (both connection strings produces the same result)


  •  Trusted Connection:
    "Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
       - or -
    "Server=Aron1;Database=pubs;Trusted_Connection=True;"
       (both connection strings produces the same result)
    (use serverName/instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
  •  Connect via an IP address:
    "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
    (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
  •  Declare the SqlConnection:
    C#:
    using System.Data.SqlClient;
    SqlConnection oSQLConn = new SqlConnection();
    oSQLConn.ConnectionString="my connection string";
    oSQLConn.Open();
    VB.NET:
    Imports System.Data.SqlClient
    Dim oSQLConn As SqlConnection = New SqlConnection()
    oSQLConn.ConnectionString="my connection string"
    oSQLConn.Open()


 

 SQL Server 2005

    •  SQL Native Client ODBC Driver
    •  SQL Native Client OLE DB Provider
    •  SqlConnection (.NET)


    •  Standard security:
      "Driver={SQL Native Client};Server=Aron1;Database=pubs;UID=sa;PWD=asdasd;"


    •  Trusted connection:
      "Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connection=yes;"
      Equivalents
      Integrated Security=SSPI equals Trusted_Connection=yes
    •  Prompt for username and password:
      oConn.Properties("Prompt") = adPromptAlways
      oConn.Open "Driver={SQL Native Client};Server=Aron1;DataBase=pubs;"


    •  Enabling MARS (multiple active result sets):
      "Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connection=yes;MARS_Connection=yes"
      Equivalents
      MultipleActiveResultSets=true equals MARS_Connection=yes

      Using MARS with SQL Native Client, by Chris Lee >>
    •  Encrypt data sent over network:
      "Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connection=yes;Encrypt=yes"
      Download the SQL Native Client here >> (the package contains booth the ODBC driver and the OLE DB provider)


    •  Standard security:
      "Provider=SQLNCLI;Server=Aron1;Database=pubs;UID=sa;PWD=asdasd;"


    •  Trusted connection:
      "Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;"
      Equivalents
      Integrated Security=SSPI equals Trusted_Connection=yes
    •  Prompt for username and password:
      oConn.Properties("Prompt") = adPromptAlways
      oConn.Open "Provider=SQLNCLI;Server=Aron1;DataBase=pubs;"


    •  Enabling MARS (multiple active result sets):
      "Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;MarsConn=yes"
      Equivalents
      MarsConn=yes equals MultipleActiveResultSets=true equals MARS_Connection=yes

      Using MARS with SQL Native Client, by Chris Lee >>
    •  Encrypt data sent over network:
      "Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;Encrypt=yes"
      Download the SQL Native Client here >> (the package contains booth the OLE DB provider and the ODBC driver)


    •  Standard Security:
      "Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
         - or -
      "Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
         (both connection strings produces the same result)


    •  Trusted Connection:
      "Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
         - or -
      "Server=Aron1;Database=pubs;Trusted_Connection=True;"
         (both connection strings produces the same result)
      (use serverName/instanceName as Data Source to use an specifik SQLServer instance)
    •  Connect via an IP address:
      "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
      (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
    •  Enabling MARS (multiple active result sets):
      "Server=Aron1;Database=pubs;Trusted_Connection=True;MultipleActiveResultSets=true"
      Note! Use ADO.NET 2.0 for MARS functionality. MARS is not supported in ADO.NET 1.0 nor ADO.NET 1.1

      Streamline your Data Connections by Moving to MARS, by Laurence Moroney, DevX.com >>
  •  
  •  
  •  Access
      •  ODBC
      •  OLE DB, OleDbConnection (.NET)


      •  Standard Security:
        "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:/mydatabase.mdb;Uid=Admin;Pwd=;"


      •  Workgroup:
        "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:/mydatabase.mdb;SystemDB=C:/mydatabase.mdw;"


      •  Exclusive:
        "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:/mydatabase.mdb;Exclusive=1;Uid=admin;Pwd="




      •  Standard security:
        "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=/somepath/mydb.mdb;User Id=admin;Password=;"


      •  Workgroup (system database):
        "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=/somepath/mydb.mdb;Jet OLEDB:System Database=system.mdw;"


      •  With password:
        "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=/somepath/mydb.mdb;Jet OLEDB:Database Password=MyDbPassword;"
内容概要:本文提出了一种基于极端梯度提升(XGBoost)算法的光伏阵列复合故障诊断方法,并提供了完整的Python代码实现。该方法充分利用XGBoost在分类任务中的高性能优势,针对光伏系统中常见的多种复合故障(如阴影遮挡、组件老化、断路与短路等)进行精准识别与分类。通过构建合理的特征工程,结合实际运行监测数据,模型能够有效区分单一故障与多重并发故障,显著提升了诊断的准确性与鲁棒性。研究体现了数据驱动方法在新能源系统智能运维中的关键作用,展示了机器学习技术在光伏系统状态监测、故障预警与健康管理方面的广阔应用前景; 适合人群:具备一定Python编程能力及机器学习基础知识的科研人员、电气工程及相关专业的硕士/博士研究生,以及从事光伏电站运维、智能诊断系统开发的工程技术人才; 使用场景及目标:① 实现对光伏阵列多类型复合故障的自动化、高精度诊断;② 掌握XGBoost在工业故障诊断场景下的建模流程、参数调优与性能评估方法;③ 构建可推广的数据驱动型新能源设备健康管理系统,提升运维效率与系统可靠性; 阅读建议:建议读者结合所提供的Python代码,深入理解从数据预处理、特征提取、模型训练到结果可视化的完整流程,建议在实际光伏监测数据上进行迁移验证,并可进一步对比其他机器学习模型(如随机森林、SVM、深度学习网络),以优化诊断系统的泛化能力与工程适用性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值