473,408 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

not associated with a trusted SQL Server connection

DMS
am new to ASP.NET and IIS web applications, but not to
SQL databases. I can successfully build Windows apps using
Visual Studio that use ADO. However, for Web Forms, I
created data connection and sqladapter to my SQL Server -
Northwind - which I dragged from Server Explorer. I
generate a dataset, and Preview Data in the da, works
fine. I then enter vb code on Page_Load event:
SqlDataAdapter1.Fill(ds)
DataGrid1.DataSource = ds.Tables("Employees")
DataGrid1.DataBind()
When I build and browse (localhost), I get:
Server Error in myapp...SqlException: Login failed for
user (null). Reason: Not associated with a trusted SQL
Server connection. (I have since found error codes
SQLState 42000 and SQL Error 18452, which could be
permissions among other things, haven't found anything
detailed on how to fix this.) The SQL mode is Windows
auth.I've tried various settings in Web.config connection
string, tried configuring IIS Virtual Directory Managment
on SQL Server setting Integrated Security and I
downloaded the .NET framework onto SQL server. I still
get the error.
Perhaps my workstation version of IIS is not configured
properly(?); do I need an IIS-server edition? Would
appreciate any help, reference to articles, etc.

Jul 21 '05 #1
2 16472
Hello,

You may need to configure SQL Server so the ASPNET user account has login
permission. This article describes how to do that:
http://msdn.microsoft.com/library/de...us/vbcon/html/
vbtskaccessingsqlserveraslocaluser.asp. The article "Accessing SQL Server
from a Web application"
(http://msdn.microsoft.com/library/de...-us/vbcon/html
/vbconaccessingsqlserverfromwebapplication.asp) contains more general
information that may also be useful.

Hope this helps,
Molly

---
Molly Bostic
..NET Developer Platform User Education

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "DMS" <dy***********@hqisec.army.mil>
Subject: not associated with a trusted SQL Server connection
Date: Mon, 29 Sep 2003 12:19:26 -0700
Newsgroups: microsoft.public.dotnet.general

am new to ASP.NET and IIS web applications, but not to
SQL databases. I can successfully build Windows apps using
Visual Studio that use ADO. However, for Web Forms, I
created data connection and sqladapter to my SQL Server -
Northwind - which I dragged from Server Explorer. I
generate a dataset, and Preview Data in the da, works
fine. I then enter vb code on Page_Load event:
SqlDataAdapter1.Fill(ds)
DataGrid1.DataSource = ds.Tables("Employees")
DataGrid1.DataBind()
When I build and browse (localhost), I get:
Server Error in myapp...SqlException: Login failed for
user (null). Reason: Not associated with a trusted SQL
Server connection. (I have since found error codes
SQLState 42000 and SQL Error 18452, which could be
permissions among other things, haven't found anything
detailed on how to fix this.) The SQL mode is Windows
auth.I've tried various settings in Web.config connection
string, tried configuring IIS Virtual Directory Managment
on SQL Server setting Integrated Security and I
downloaded the .NET framework onto SQL server. I still
get the error.
Perhaps my workstation version of IIS is not configured
properly(?); do I need an IIS-server edition? Would
appreciate any help, reference to articles, etc.

--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
Jul 21 '05 #2
Dyanna,

When you create the Connection on the page, it uses your connection information that you supply, probably set to use a Trusted
Connection to connect to SQL. At runtime, it tries to use a trusted connection again, but this time the application is not running
as you, the logged in user, but as ASPNet, the ASP .Net user account. You should set the ConnectionString on your SQLConnection
before doing the DataBind() in the Page_Load(), and instead of using a trusted connection, use a SQL user, or make sure that your
account under which you run the website is allowed to connect to your SQL Server.

Regards

Thys Brits
MCSD/MCSD.Net

"DMS" <dy***********@hqisec.army.mil> wrote in message news:0b****************************@phx.gbl...
am new to ASP.NET and IIS web applications, but not to
SQL databases. I can successfully build Windows apps using
Visual Studio that use ADO. However, for Web Forms, I
created data connection and sqladapter to my SQL Server -
Northwind - which I dragged from Server Explorer. I
generate a dataset, and Preview Data in the da, works
fine. I then enter vb code on Page_Load event:
SqlDataAdapter1.Fill(ds)
DataGrid1.DataSource = ds.Tables("Employees")
DataGrid1.DataBind()
When I build and browse (localhost), I get:
Server Error in myapp...SqlException: Login failed for
user (null). Reason: Not associated with a trusted SQL
Server connection. (I have since found error codes
SQLState 42000 and SQL Error 18452, which could be
permissions among other things, haven't found anything
detailed on how to fix this.) The SQL mode is Windows
auth.I've tried various settings in Web.config connection
string, tried configuring IIS Virtual Directory Managment
on SQL Server setting Integrated Security and I
downloaded the .NET framework onto SQL server. I still
get the error.
Perhaps my workstation version of IIS is not configured
properly(?); do I need an IIS-server edition? Would
appreciate any help, reference to articles, etc.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TBone | last post by:
Anyone, I have a user "john" whose machine is part of the "job" domain. He is trying to establish an odbc connection to an MS SQL 2000 server on the "school" domain. He uses Windows...
1
by: Mark | last post by:
We are using impersonation so that a user on our domain will login into our SQL Server using their own domain login and/or associated domain groups. To do this, we've added: <authentication...
4
by: Brian Henry | last post by:
I an trying to connect to a sql server in asp.net with the sql connection object, and every time i try to open the connection i get this Server Error in '/' Application. Login failed for user...
7
by: Ray Valenti | last post by:
I am able to preview this data in the development environment, but when I run the application the error below shows up. How do I set up a Trusted Connection? -Ray Server Error in...
4
by: rrober07 | last post by:
Hello, My Setup is I have a Web Server machine(Devweb01), Database SQL Machine(Devsql01), a Client Machine(local machine) I have configured the SQL machine as follows: 1) Added local Aspnet...
2
by: DMS | last post by:
am new to ASP.NET and IIS web applications, but not to SQL databases. I can successfully build Windows apps using Visual Studio that use ADO. However, for Web Forms, I created data connection and...
1
by: jerminator | last post by:
Ok I need some help. Up until Tuesday my application was working fine. It is an asp.net application written in VB. It is very data heavy and makes multiple calls to a database. The application...
3
by: Newbie19 | last post by:
I'm having an issue with viewing my ASP/SQL application in Internet Explorer. I get the error from my Server (located on my PC using IIS 5.0) stating: Login failed for user '(null)'. Reason:...
4
by: eruth | last post by:
There are loads of post on this, but nothing that seems to cover my exact problem ;) I have an ASP.Net 1.1 web application running on my local machine. I want to connect to an SQL 2005 server...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.