By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

error when connecting to database question in asp.net

P: n/a
dk
this is the DSN connection string in web.confi

<add key="DSN" value="server=localhost;database=userDB;Integrated Security=SSPI" /

any idea regarding what is causing this following error message when the connection object trys to open
tia
d

Server Error in '/FormsAuth' Application
-------------------------------------------------------------------------------

Login failed for user 'CHODRON\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'CHODRON\ASPNET'

Source Error:

Line 95: strCn=System.Configuration.ConfigurationSettings.A ppSettings["DSN"].ToString()
Line 96: SqlConnection cn=new SqlConnection(strCn)
Line 97: cn.Open()
Line 98: tr
Line 99:
Source File: c:\inetpub\wwwroot\formsauth\userdb.cs Line: 97

Stack Trace:

[SqlException: Login failed for user 'CHODRON\ASPNET'.
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction
System.Data.SqlClient.SqlConnection.Open(
FormsAuth.UserDB.SaveNewUser(String UserName, String LastName, String FirstName, String email, String PasswordHash, String Salt, Boolean MustChangePassword) in c:\inetpub\wwwroot\formsauth\userdb.cs:9
FormsAuth.User.SaveNewUser(String UserName, String LastName, String FirstName, String email, String Password, Boolean MustChangePassword) in c:\inetpub\wwwroot\formsauth\user.cs:16
FormsAuth.Register.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\formsauth\register.aspx.cs:7
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +10
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +5
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +1
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +3
System.Web.UI.Page.ProcessRequestMain() +127

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
CMA
try using this connection string .....

<add key="DSN" value="server=localhost;database=userDB;uid=databa se user
name;pwd=database user password;Connection Lifetime=0"/>

if u need to hide the password, u have to use encrypted way to do it..

hope this helps,
CMA
"dk" <an*******@discussions.microsoft.com> wrote in message
news:C0**********************************@microsof t.com...
this is the DSN connection string in web.config

<add key="DSN" value="server=localhost;database=userDB;Integrated Security=SSPI" />
any idea regarding what is causing this following error message when the connection object trys to open? tia,
dk
Server Error in '/FormsAuth' Application.
-------------------------------------------------------------------------- ------
Login failed for user 'CHODRON\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'CHODRON\ASPNET'.
Source Error:
Line 95: strCn=System.Configuration.ConfigurationSettings.A ppSettings["DSN"].ToString
(); Line 96: SqlConnection cn=new SqlConnection(strCn);
Line 97: cn.Open();
Line 98: try
Line 99: {
Source File: c:\inetpub\wwwroot\formsauth\userdb.cs Line: 97

Stack Trace:
[SqlException: Login failed for user 'CHODRON\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open()
FormsAuth.UserDB.SaveNewUser(String UserName, String LastName, String FirstName, String email, String PasswordHash, String Salt, Boolean
MustChangePassword) in c:\inetpub\wwwroot\formsauth\userdb.cs:97 FormsAuth.User.SaveNewUser(String UserName, String LastName, String FirstName, String email, String Password, Boolean MustChangePassword) in
c:\inetpub\wwwroot\formsauth\user.cs:168 FormsAuth.Register.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\formsauth\register.aspx.cs:72 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.