Linux中国  设为主页
 收藏本站
 
当前位置: > 首页 ->数据库应用 ->其他数据库 ->数据库连接字符串大全
  相关分类: 
Access
DB2
Mysql
Oracle
PostgreSQL
SQL Server
Sybase
其他数据库
  站内搜索: 
热门文章排行
热门文章排行 数据库连接字符串大全(06-03)
海量数据库的查询优化及分页算法方案(04-23)
sql年月日计算方法(06-03)
有关 Eclipse 运行命令行参数大全 (04-23)
sql 经典语句(06-03)
精采文章排行
精采文章排行 分析数据库备份过程中九种易出现的情(06-29)
第七届Teradata数据仓库峰会在上海召(06-29)
SQL语句游标For.Loop与Open.Close比(06-29)
渗透测试中攻与守之数据库系统渗透简(06-29)
容灾可捍卫数据安全 确保信息即时恢(06-29)
 

数据库连接字符串大全

作者:Webmaster   来源:Linuxdby.com   点击:   日期:2007-06-03 [收藏] [投稿]

  IE是否经常中毒?推荐您

·罗维数据库营销的网络化 改善客户体验 ·精华推荐 数据库系统专用词汇集锦之二 ·轻松七个步骤帮助你来顺利开发数据仓库 ·SQL语句基础学习 帮你明了数值数据类型 ·SQL语句基础学习 从子表里如何删除数据 ·SQL语句基础学习 子选择如何来合并查询 ·逐行扫描 为你讲解几个基本SQLPLUS命令 ·精华推荐 数据库系统专用词汇集锦之一 ·数据库基础知识帮你分析何为ASP数据库
转自:http://www.connectionstrings.com/
  •  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:
        "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()

    •  Data Shape

  • 文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论

       相关文章:
    ·精华推荐 数据库系统专用词汇集锦之三

       文章评论:(1条)
      
     请留名: 匿名评论   点击查看所有评论 论坛讨论
     

     声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。