积极答复者
asp.net开发问题

问题
-
堆栈跟踪:
[SqlException (0x80131904): 用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联。]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +575
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +160
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122
System.Data.SqlClient.SqlConnection.Open() +229
EnterPrise.DAL.DBHelper.get_Sqlconnection() in F:\毕业设计\企业网站\EnterPrise\EnterPriseDAL\DBHelper.cs:33
EnterPrise.DAL.DBHelper.GetDataSet(String sql) in F:\毕业设计\企业网站\EnterPrise\EnterPriseDAL\DBHelper.cs:66
EnterPrise.DAL.NewService.GetNewBySql(String sql) in F:\毕业设计\企业网站\EnterPrise\EnterPriseDAL\NewService.cs:55
EnterPrise.DAL.NewService.GetTopNew() in F:\毕业设计\企业网站\EnterPrise\EnterPriseDAL\NewService.cs:144
我的程序压根跟 F:\毕业设计\企业网站\这个目录没有关系。我这个是从别人那里考过来的。但是一直提示我sa登陆失败。
答案
-
这个一般不是程序的问题的,主要是数据库连字符串的写法,数据库设置,端口设置(如有防火墙,也禁用掉)导致的
数据库连接字符串的写法参考
http://connectionstrings.com/
有多种写法,
如果传程序,需要明天才可以
孟宪会- 已标记为答案 KeFang Chen 2009年4月16日 8:14
-
很明显,是数据库的连接问题。
1、检查后台数据库安装是否正常,
2、检查Sql server设置是否正常,是否允许Sql Server身份验证
3、检查网站的数据库连接字符串是否正确
a flying bird- 已标记为答案 KeFang Chen 2009年4月16日 8:13
-
这是数据库设置问题。
你需要启用 sa账户。并设置相应的权限,连接修改为
sqlconnection = new SqlConnection("Data Source=.;Initial Catalog=EnterPrise;User Id=sa;Password=sa密码");
也可以自己创建也该新的登录名aaa并设置相应的权限
sqlconnection = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=EnterPrise;User Id=aaa;Password=aaa");
sqlconnection = new SqlConnection("Data Source=(lcoal);Initial Catalog=EnterPrise;User Id=aaa;Password=aaa");
sqlconnection = new SqlConnection("Data Source=.;Initial Catalog=EnterPrise;User Id=aaa;Password=aaa");
具体怎么设置与你的数据库有关系。
你的数据库附加的时候一定要附加为EnterPrise
孟宪会- 已标记为答案 KeFang Chen 2009年4月16日 8:13
全部回复
-
如果你的asp.net很好的话,可以加我的QQ:29985884我把程序传给你,你帮我看下,邮箱也行。debing87_chin@hotmail.com
-
这个一般不是程序的问题的,主要是数据库连字符串的写法,数据库设置,端口设置(如有防火墙,也禁用掉)导致的
数据库连接字符串的写法参考
http://connectionstrings.com/
有多种写法,
如果传程序,需要明天才可以
孟宪会- 已标记为答案 KeFang Chen 2009年4月16日 8:14
-
很明显,是数据库的连接问题。
1、检查后台数据库安装是否正常,
2、检查Sql server设置是否正常,是否允许Sql Server身份验证
3、检查网站的数据库连接字符串是否正确
a flying bird- 已标记为答案 KeFang Chen 2009年4月16日 8:13
-
这是数据库设置问题。
你需要启用 sa账户。并设置相应的权限,连接修改为
sqlconnection = new SqlConnection("Data Source=.;Initial Catalog=EnterPrise;User Id=sa;Password=sa密码");
也可以自己创建也该新的登录名aaa并设置相应的权限
sqlconnection = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=EnterPrise;User Id=aaa;Password=aaa");
sqlconnection = new SqlConnection("Data Source=(lcoal);Initial Catalog=EnterPrise;User Id=aaa;Password=aaa");
sqlconnection = new SqlConnection("Data Source=.;Initial Catalog=EnterPrise;User Id=aaa;Password=aaa");
具体怎么设置与你的数据库有关系。
你的数据库附加的时候一定要附加为EnterPrise
孟宪会- 已标记为答案 KeFang Chen 2009年4月16日 8:13