Friday, February 17, 2012

connecting with database

Using web dev and sql 2005 express

I have published web app and database to my server but can,t get connection string to connect with the database.

---------------------

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

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 ''. The user is not associated with a trusted SQL Server connection.

---------------------

I have created a user in the logins in the sql server security node and give him every permission

going.

I have also created a login in the security node for the database.... and given him all permissions

But I still can,t get the connection string from the web app to connect to the database?

Where am I going wrong

Can you show us your connection string?

|||Try to provide the user name and password in your connection string instead of using Integrated Security=True

|||

I have one database on the server with both the asp.net and my own database within it.

<addname="*******************"connectionString="Data Source=*********.*******.com;Initial Catalog=mydatabasename;Integrated Security=True;User Id=nameofpersonindatabaseschema;Password=hispassword;Connection Timeout=40;User Instance=True"providerName="System.Data.SqlClient" />

<removename="LocalSqlServer"/>

<addname="LocalSqlServer"connectionString="Data Source=*******.*********.com;Initial Catalog=mydatabasename;Integrated Security=True;User Id=nameofpersonindatabaseschema;Password=hispassword;Connection Timeout=40;User Instance=True"providerName="System.Data.SqlClient" />

Now I diid change a few minutes ago .........integrated security =false and got this

---------------

Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.

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: Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.
--------------

Never seen that error before.....

|||

Remove "User Instance=True" and "Integrated Security=True" and set the server to accept SQL Authentication.

|||

OOh sweet...all working...web app loading to server.

now to down grade permissions

well done fatman

No comments:

Post a Comment