|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Login failed for user ''. The user is not associated with a trusted SQL Server connection.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 ? 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 --- 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" /> as stated in my other response -
you are using integrated authentication - this means that the current worker process account is used to connect to sql server - which is ASPNET on XP. This will not work, as you can't grant access to ASPNET on a remote machine. Either impersonate a windows account that that has access to the the sql server machine / database or supply explicit credentials of an sql server account in the connection string. you may have to change the authentication mode from windows to mixed in sql server. --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > 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" /> 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 --- Hi
How do you set up your database? A Windows Authenication or Mixed? <CLar***@gmail.com> wrote in message Show quoteHide quote news:1142862649.046140.21050@z34g2000cwc.googlegroups.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 ? > 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 --- 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. you only have to setup delegation if you want to use the clients' credentials
for the sql server login - in this case he just trying to use the process account - which will not work for the ASPNET account. --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > 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. > Apologies for my questions/answers.The security accounts should be set
on SQL SErver machine or on IIS ? 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. -- Show quoteHide quoteThis 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 <CLar***@gmail.com> wrote in message news:1142867073.546213.317310@t31g2000cwb.googlegroups.com... > Hi, I set it as "Integrated Security=True" > 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 ? no - the current security identity is used (which is different is file system
projects) you can output that using: WindowsIdentity.GetCurrent().Name --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > 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 ? > 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. -- Show quoteHide quoteThis 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 <CLar***@gmail.com> wrote in message news:1142922538.964796.18230@e56g2000cwe.googlegroups.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 ? > he never mentioned he is impersonating in asp.net - so no delegation needed.
Cassini runs with the credentials of the interactive user - which seems to have access to sql - in contrast to the local ASPNET account - which i am trying to tell him since 2 days.... yes - use explicit credentials and enable mixed mode auth in sql server to get this to work. --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > 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. > > <CLar***@gmail.com> wrote in message > news:1142922538.964796.18230@e56g2000cwe.googlegroups.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 ? >> you web application runs under the ASPNET account, which has no meaning on
the sql box - use the <identity> element or impersonate a fixed account (one that exists on the sql box) or supply credentials in the sql connection string. --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > 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 ? > 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 Show quoteHide quote "CLar***@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 ? 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. -- Show quoteHide quoteThis 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" <Sim***@discussions.microsoft.com> wrote in message news:DE86DF27-722A-4665-B1D4-66FBD596461C@microsoft.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 > > "CLar***@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 ? >
Encrypted Data Storage ? HowTo ?
WebService Windows Authentication ASP.NET 2.0 Impersonate users and roles Problems with AzMan interop and CLR 2 Ent. Library w/DB 2 registry access problem ASP.NET writing to EventLog in Server 2003 internet explorer 6 sp2 ¤ China ZhongZhan Aids Mei Mei ¤ China ZhongZhan Aids Mei Mei |
|||||||||||||||||||||||