ADO.NET连接字符串

 
ADO.NET连接字符串
2008-04-15 12:49
名称 ADO.NET连接字符串说明ADO.NET连接字符串:SQL Server,SQL Server 2005,ACCESS,Oracle,MySQL,Interbase,IBM DB2,Sybase,Informix,Ingres,Mimer SQL,Lightbase,PostgreSQL,Paradox,DNS,Firebird,Excel ,Text,DBF / FoxPro,AS/400 (iSeries),Exchange,Visual FoxPro,Pervasive,UDL。 1 - SQL Server
2 - SQL Server 2005
3 - ACCESS, Oracle
4 - MySQL, Interbase, IBM DB2
5 - Sybase, Informix, Ingres, Mimer SQL, Lightbase, PostgreSQL, Paradox, DNS
6 - Firebird, Excel , Text, DBF / FoxPro, AS/400 (iSeries), Exchange, Visual FoxPro, Pervasive, UDL1SQL ServerODBC标准安全" Driver={SQL Server}; Server=Aron1; Database=pubs; Uid=sa; Pwd=asdasd; "信任的连接" Driver={SQL Server}; Server=Aron1; Database=pubs; Trusted_Connection=yes; "提示输入用户名和密码oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Driver={SQL Server}; Server=Aron1; DataBase=pubs; "OLE DB, OleDbConnection (.NET)标准安全" Provider=sqloledb; Data Source=Aron1; Initial Catalog=pubs; User Id=sa; Password=asdasd; "信任的连接" 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)提示输入用户名和密码oConn.Provider = " sqloledb"
oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Data Source=Aron1; Initial Catalog=pubs; "IP地址连接管道" 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)标准安全" 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)信任的连接" 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)IP地址连接管道" 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对象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 ShapeMS Data Shape" Provider=MSDataShape; Data Provider=SQLOLEDB; Data Source=Aron1; Initial Catalog=pubs; User ID=sa; Password=asdasd; "2SQL Server 2005SQL Native Client ODBC Driver标准安全" Driver={SQL Native Client}; Server=Aron1; Database=pubs; UID=sa; PWD=asdasd; "信任的连接" Driver={SQL Native Client}; Server=Aron1; Database=pubs; Trusted_Connection=yes; "
Equivalents
Integrated Security=SSPI equals Trusted_Connection=yes提示输入用户名和密码oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Driver={SQL Native Client}; Server=Aron1; DataBase=pubs; "授权的MARS(多重活动结果集)" Driver={SQL Native Client}; Server=Aron1; Database=pubs; Trusted_Connection=yes; MARS_Connection=yes"
Equivalents
MultipleActiveResultSets=true equals MARS_Connection=yes加密数据网络传输" Driver={SQL Native Client}; Server=Aron1; Database=pubs; Trusted_Connection=yes; Encrypt=yes"在本地SQL服务器实例附加数据库文件" Driver={SQL Native Client}; Server=./SQLExpress; AttachDbFilename=c:/asd/qwe/mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
- or -
" Driver={SQL Native Client}; Server=./SQLExpress; AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
(use |DataDirectory| when your database file resides in the data directory)SQL Native Client OLE DB Provider标准安全" Provider=SQLNCLI; Server=Aron1; Database=pubs; UID=sa; PWD=asdasd; "信任的连接" Provider=SQLNCLI; Server=Aron1; Database=pubs; Trusted_Connection=yes; "
Equivalents
Integrated Security=SSPI equals Trusted_Connection=yes提示输入用户名和密码oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Provider=SQLNCLI; Server=Aron1; DataBase=pubs; "授权的MARS(多重活动结果集)" Provider=SQLNCLI; Server=Aron1; Database=pubs; Trusted_Connection=yes; MarsConn=yes"
Equivalents
MarsConn=yes equals MultipleActiveResultSets=true equals MARS_Connection=yes加密数据网络传输" Provider=SQLNCLI; Server=Aron1; Database=pubs; Trusted_Connection=yes; Encrypt=yes"在本地SQL服务器实例附加数据库文件" Provider=SQLNCLI; Server=./SQLExpress; AttachDbFilename=c:/asd/qwe/mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
- or -
" Provider=SQLNCLI; Server=./SQLExpress; AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
(use |DataDirectory| when your database file resides in the data directory)SqlConnection (.NET)标准安全" 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)信任的连接" Data Source=Aron1; Initial Catalog=pubs; Integrated Security=SSPI; "
- or -
" Server=Aron1; Database=pubs; Trusted_Connection=True; "
(both connection strings produces the same result)IP地址连接管道" 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))授权的MARS(多重活动结果集)" 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在本地SQL服务器实例附加数据库文件" Server=./SQLExpress; AttachDbFilename=c:/asd/qwe/mydbfile.mdf; Database=dbname; Database=dbname; Trusted_Connection=Yes; "
- or -
" Server=./SQLExpress; AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "Using " User Instance" on a local SQL Server Express instance" Data Source=./SQLExpress; integrated security=true; attachdbfilename=|DataDirectory|/mydb.mdf; user instance=true; "
The " User Instance" functionality creates a new SQL Server instance on the fly during connect. This works only on a local SQL Server 2005 instance and only when connecting using windows authentication over local named pipes. The purpose is to be able to create a full rights SQL Server instance to a user with limited administrative rights on the computer. To enable the functionality: sp_configure 'user instances enabled','1' (0 to disable)
Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME/SQLEXPRESS (Substitute " SERVERNAME" with the name of the computer)
Context Connection - connecting to " self" from within your CLR stored prodedure/functionContext Connection - connecting to " self" from within your CLR stored prodedure/functionC#using(SqlConnection connection = new SqlConnection("context connection=true"))
{
connection.Open();
// Use the connection
}Visual BasicUsing connection as new SqlConnection("context connection=true")
connection.Open()
' Use the connection
End UsingRead moreWhen to use SQL Native Client?.Net applications
Do not use the SQL Native Client. Use the .NET Framework Data Provider for SQL Server (SqlConnection).
COM applications, all other then .Net applicationsCOM applications, all other then .Net applications
Use the SQL Native Client if you are accessing an SQL Server 2005 and need the new features of SQL Server 2005 such as MARS, encryption, XML data type etc. Continue use your current provider (OLE DB / ODBC through the MDAC package) if you are not connecting to an SQL Server 2005 (that's quite obvious eh..) or if you are connecting to an SQL Server 2005 but are not using any of the new SQL Server 2005 features.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
内容如下:<br>ado.net 概述 <br>ado.net 的设计目标 <br>ado.net 结构 <br>.net 数据提供程序 <br>ado.net dataset <br>为 .net 数据提供程序编写通用代码 <br>ado.net 示例应用程序 <br>使用.net数据提供程序访问数据 <br>使用 ado.net 连接到数据源 <br>执行命令 <br>使用datareader检索数据 <br>将存储过程用于命令 <br>从数据库中获取单个值 <br>从数据库中获取blob 值 <br>执行数据库操作和修改数据 <br>从sql server中以xml形式获取数据 <br>从dataadapter填充 dataset <br>使用dataadapter和dataset更新数据库 <br>向dataset添加现有约束 <br>设置datatable和datacolumn映射 <br>将参数用于dataadapter <br>输入和输出参数及返回值 <br>自动生成的命令 <br>使用dataadapter 事件 <br>从数据库中获取架构信息 <br>执行事务 <br>.net数据提供程序的代码访问安全性 <br>创建和使用 dataset <br>创建 dataset <br>向 dataset 添加 datatable <br>添加表间关系 <br>导航表间关系 <br>将 dataset 与现有数据一起使用 <br>合并 dataset 内容 <br>复制 dataset 内容 <br>使用 dataset 事件 <br>使用类型化的 dataset <br>xml 和 dataset <br>diffgram <br>从 xml 中加载 dataset <br>以 xml 数据形式编写 dataset <br>从 xml 中加载 dataset 架构信息 <br>以xml架构(xsd)形式编写dataset架构信息 <br>使 dataset 与 xmldatadocument 同步 <br>嵌套的 datarelation <br>从xml架构(xsd)生成dataset关系结构 <br>将xml架构(xsd)约束映射到dataset 约束 <br>从xml架构(xsd)生成dataset关系 <br>了解约束和关系之间的相互关系 <br>从xml推断dataset关系结构 <br>创建和使用数据表 <br>创建数据表 <br>定义数据表的架构 <br>在数据表中操作数据 <br>创建和使用dataview <br>创建dataview <br>使用dataview对数据排序和筛选 <br>使用dataview查看数据 <br>使用dataview修改数据 <br>使用dataview事件 <br>使用dataviewmanager设置默认表视图据 <br>从ado.net访问ado记录集或记录 <br>ado.net方案示例 <br>检索“标识”或“自动编号”值 <br>开放式并发 <br>从 xml web services 使用 dataset <br>查询结果分页 <br>实现.net数据提供程序 <br>.net 数据提供程序实现入门 <br>实现连接 <br>实现命令 <br>实现 datareader <br>实现 dataadapter <br>示例 .net 数据提供程序 <br>数据集 <br>数据集介绍 <br>用于创建数据集的visual studio工具 <br>用组件设计器创建类型化数据集 <br>用表达式创建数据集列 <br>将表添加到现有数据集 <br>将现有类型化数据集添加到窗体或组件 <br>将非类型化数据集添加到窗体或组件 <br>演练:将数据源表映射到数据集表 <br>数据适配器 <br>数据适配器介绍 <br>数据适配器命令中的参数 <br>数据适配器中的表映射 <br>创建数据适配器 <br>为数据适配器配置参数 <br>将数据源列映射到数据集数据表列 <br>预览数据适配器的结果 <br>数据连接 <br>sqlconnection 概述 <br>sqlcommand 概述

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值