473,320 Members | 1,881 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,320 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 16466
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.