to 91bct(行人): 因为是集成windows的安全设置,所以登录数据库不要输入用户名和密码,即“与登陆windows的身份相同。 我登陆windows的身份为administrator,但运行vs.net看到他用ASPNET登录,我在数据库中增加了ASPNET用户,登录成功,但我想知道能不能更改这个登录用户。
Standard Security: "Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;" Trusted Connection: "Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;" (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 connectionstring"; oSQLConn.Open(); VB.NET: Imports System.Data.SqlClient Dim oSQLConn As SqlConnection = New SqlConnection() oSQLConn.ConnectionString="my connectionstring" oSQLConn.Open()
Integrated Security=SSPI表示使用集成登录
我用你的方法试过了但是说我的用户不能登录,为什么?
请问vs.net能不能更改?在哪更改呢?
请问vs.net能不能更改?在哪更改呢?
packet size=4096;
integrated security=SSPI;//表示用当前的登陆windows的身份登陆数据库
data source=(本机机器名或IP或用local);
persist security info=False;
initial catalog=eForum//eForum这是数据库名【默认的登录用户是:机器名/ASPNET,数据库中没有此用户,所有登录不成功,
请问vs.net能不能更改?在哪更改呢?】
你正常用什么身份登录数据库的?是单独使用某个用户名还是与登陆windows的身份相同的?
你出现的问题应该跟你数据库的设置有关。
因为是集成windows的安全设置,所以登录数据库不要输入用户名和密码,即“与登陆windows的身份相同。
我登陆windows的身份为administrator,但运行vs.net看到他用ASPNET登录,我在数据库中增加了ASPNET用户,登录成功,但我想知道能不能更改这个登录用户。
"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
Trusted Connection:
"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
(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 connectionstring";
oSQLConn.Open(); VB.NET:
Imports System.Data.SqlClient
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString="my connectionstring"
oSQLConn.Open()