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

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

P: n/a
My machine has Win XP and IIS 5.1.

I installed Visual Studio 2005 without SQL Express 2005. SQL Server
2005 is installed on another machine with Win 2003.

I created a Web Site in .NET VB. I created a connection with my SQL
server database, I can retrieve/ change data in SERVER EXPLORER. When I
try to create a gridview with data fron one table and to run the web
page in Internet Explorer I receive the following error.

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

Can you please help me ?

Mar 20 '06 #1
Share this Question
Share on Google+
14 Replies


P: n/a
Which connection string are you using to connect to the database, I
guess you are using SQL Server authentication which isnīt setup
properly on your computer.

So switch to mixed authentication, or use a Windows account to connect
to the database-

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---

Mar 20 '06 #2

P: n/a
Which connection string are you using to connect to the database, I
guess you are using SQL Server authentication which isnīt setup
properly on your computer.

So switch to mixed authentication, or use a Windows account to connect
to the database-

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---

Mar 20 '06 #3

P: n/a
Hi
How do you set up your database? A Windows Authenication or Mixed?

<CL*****@gmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
My machine has Win XP and IIS 5.1.

I installed Visual Studio 2005 without SQL Express 2005. SQL Server
2005 is installed on another machine with Win 2003.

I created a Web Site in .NET VB. I created a connection with my SQL
server database, I can retrieve/ change data in SERVER EXPLORER. When I
try to create a gridview with data fron one table and to run the web
page in Internet Explorer I receive the following error.

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

Can you please help me ?

Mar 20 '06 #4

P: n/a
I am using the following:

<remove name="LocalSqlServer" />
<add name="SubDispConnectionString1" connectionString="Data
Source=CYNICSQL1;Initial Catalog=SubDisp;Integrated Security=True"
providerName="System.Data.SqlClient" />

Mar 20 '06 #5

P: n/a
Hi, I set it as "Integrated Security=True"

Mar 20 '06 #6

P: n/a
No, this is just the connection string, not themode SQL Server is set
to. The one (COnnectionString) is the client, the authentication mode
(mixed) is the server side.
HTH, Jens Suessmeyer.
---
http://www.sqlserver2005.de
---

Mar 20 '06 #7

P: n/a
The reason people keep asking about authentication modes is that this error
message usually means you are trying to connect with a SQL Server login to a
SQL Server instance that only supports Windows authentication. It sounds
like this is not your issue because you are connecting with Integrated
Security and not supplying a user name or password. The other possible
cause is that the Windows user has no right to authenticate a Windows
connection on the server where SQL Server is running. This can be a "double
hop" error if you are using Windows authentication on the Web site. It
could also be a case that ASPUSER has no rights to connect to the SQL Server
machine.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

<CL*****@gmail.com> wrote in message
news:11**********************@t31g2000cwb.googlegr oups.com...
Hi, I set it as "Integrated Security=True"

Mar 20 '06 #8

P: n/a
I tried creating a website with FILE SYSTEM, not HTTP, and I was able
to open the web page in IE with SQL server data. ASPUSER is used for
connecting to the SQL SERVER machine with FILE SYSTEM web site ?

Mar 21 '06 #9

P: n/a
The server authentication is "Windows Authentication Mode".

Mar 21 '06 #10

P: n/a
Keep in mind that if the SQL Server is NOT on the same box as the IIS,
you have to setup delegation of the security accounts that this works.
Otherwise the SQL Server canīt check if your User is *really* the
original one.

HTH, Jens Suessmeyer.

Mar 21 '06 #11

P: n/a
Apologies for my questions/answers.The security accounts should be set
on SQL SErver machine or on IIS ?

Mar 21 '06 #12

P: n/a
I assume when you used filesystem, you had IE running on the same box as the
web server so there was just a single hop for authentication and thus
delegation was not needed. I also assume filesystem runs with your
credentials - not ASPUSER but I'm not an expert on ASP.Net. Your problem
could be either ASPUSER not having permissions or delegation. The easiest
solution for either one is to setup a SQL Server authenticated login and try
connecting by putting the user name and password in the connection string.
If that works you at least know what the problem is and can try to address
it.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

<CL*****@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
I tried creating a website with FILE SYSTEM, not HTTP, and I was able
to open the web page in IE with SQL server data. ASPUSER is used for
connecting to the SQL SERVER machine with FILE SYSTEM web site ?

Mar 21 '06 #13

P: n/a
I get this problem starting up the App.
It isn't even carrying out the connection the SQL.
I have had a go at tracking the problem, and if I remove the lines below in
my WEB.CONFIG then it starts up OK

<appSettings>
<add key="ConnectionString1"
value="server=myserver;uid=myuserid;pwd=mypassword ;database=mydb"/>
</appSettings>

The cause is if you put these lines in the wrong place.
Ensure that <appsettings> is not inside another block.
cheers
Simon

"CL*****@gmail.com" wrote:
My machine has Win XP and IIS 5.1.

I installed Visual Studio 2005 without SQL Express 2005. SQL Server
2005 is installed on another machine with Win 2003.

I created a Web Site in .NET VB. I created a connection with my SQL
server database, I can retrieve/ change data in SERVER EXPLORER. When I
try to create a gridview with data fron one table and to run the web
page in Internet Explorer I receive the following error.

Login failed for user ''. The user is not associated with a trusted SQL
Server connection.
Can you please help me ?


Mar 31 '06 #14

P: n/a
You're supplying a user name and password which makes this a SQL Server user
login. The error you're getting says you are trying to log in with a SQL
login to a SQL Server that only support Windows authentication.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"SimonW" <Si****@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
I get this problem starting up the App.
It isn't even carrying out the connection the SQL.
I have had a go at tracking the problem, and if I remove the lines below
in
my WEB.CONFIG then it starts up OK

<appSettings>
<add key="ConnectionString1"
value="server=myserver;uid=myuserid;pwd=mypassword ;database=mydb"/>
</appSettings>

The cause is if you put these lines in the wrong place.
Ensure that <appsettings> is not inside another block.
cheers
Simon

"CL*****@gmail.com" wrote:
My machine has Win XP and IIS 5.1.

I installed Visual Studio 2005 without SQL Express 2005. SQL Server
2005 is installed on another machine with Win 2003.

I created a Web Site in .NET VB. I created a connection with my SQL
server database, I can retrieve/ change data in SERVER EXPLORER. When I
try to create a gridview with data fron one table and to run the web
page in Internet Explorer I receive the following error.

Login failed for user ''. The user is not associated with a trusted SQL
Server connection.
Can you please help me ?

Mar 31 '06 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more .NET Framework Questions on Bytes