473,396 Members | 1,608 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,396 software developers and data experts.

Error with ASP.net Web page when accessing database

123 100+
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: Not associated with a trusted SQL Server connection.
I am connected to the database because I can view it in VS 05 and run test queries on it in VS.

However, when I view the application on Internet explorer I get the error. My connection string is:
ConnectionString="Data Source=Hostname address; Initial Catalog=databasename; trusted_connection=true;"

I've even added: User ID=ID; password = Password; and put trusted_connection as false, but I get failed to login error instead.


This is the stack I get:

Code: ( sql )
[SqlException (0x80131904): Login failed FOR user '(null)'. Reason: NOT associated WITH a TRUSTED SQL Server connection.]
System.DATA.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, BOOLEAN breakConnection) +734931
System.DATA.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +188
System.DATA.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.DATA.SqlClient.SqlInternalConnectionTds.Com pleteLogin(BOOLEAN enlistOK) +33
System.DATA.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, BOOLEAN redirectedUserInstance) +628
System.DATA.SqlClient.SqlInternalConnectionTds..ct OR(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, BOOLEAN redirectedUserInstance) +170
System.DATA.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
System.DATA.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.DATA.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +424
System.DATA.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
System.DATA.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +496
System.DATA.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +82
System.DATA.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.DATA.SqlClient.SqlConnection.Open() +111
System.DATA.Common.DbDataAdapter.FillInternal(DATA SET dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.DATA.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.DATA.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.SELECT(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.Perform SELECT() +149
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.Ens ureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundContro l.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(BOOLEAN includeStagesBeforeAsyncPoint, BOOLEAN includeStagesAfterAsyncPoint) +1360


Thank you for any help that can be provided.

Newbie19
Jun 11 '07 #1
3 2491
Frinavale
9,735 Expert Mod 8TB
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: Not associated with a trusted SQL Server connection.
I am connected to the database because I can view it in VS 05 and run test queries on it in VS.

However, when I view the application on Internet explorer I get the error. My connection string is:
ConnectionString="Data Source=Hostname address; Initial Catalog=databasename; trusted_connection=true;"

I've even added: User ID=ID; password = Password; and put trusted_connection as false, but I get failed to login error instead.

This is the stack I get:

...

Thank you for any help that can be provided.

Newbie19
Hi there,

Check out the sections on Connection strings in this .NET Article on how to use a database in your program....try just using one like the example and see if it makes a difference...also check to make sure that your user name and password matches that of the database user.

Cheers!
-Frinny
Jun 11 '07 #2
nateraaaa
663 Expert 512MB
Check your web.config to be sure that you added
<identity impersonate="true" />

Your trusted connection will not work properly if this is not added to the web.config.

Nathan
Jun 11 '07 #3
Newbie19
123 100+
Thank you for all your help, nateraaaa your advice help a lot.

Thanks again everyone.

Newbie 19
Jun 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: M P | last post by:
What does this mean? I am accessing an ASP page that queries Access Database thru fileDSN. I'm using IIS 5.0 Win2K SP4 Microsoft OLE DB Provider for ODBC Drivers error '80004005' General...
3
by: James Bird | last post by:
Hello In order to perform a hetrogeneous join (I think that's what they're called) between MySQL and another database, I've created an Access database containing linked tables from each...
1
by: TJRobertsJob | last post by:
Was wondering if someone could help. Over the last month I've been developing a small database application, using Access 2000, for use in a friends shop. Everything was going well until about a...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
4
by: Pritam Javale | last post by:
When using Datagrid ASP.NET pages, the time required to execute a report is much more greater than when the same report is generated using a ASP page. Also the ASPX page almost always gives a...
2
by: KCHighland | last post by:
We have an ASP.NET application that permits anonymous access and runs as the IUSR account. The application accesses a SQL Server database located on a different server. All the data access code is...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
13
by: Praveen_db2 | last post by:
Hi All db2 8.1.3 Windows I am getting this error in db2diag.log.Please tell why is this error (-444) always there and how to go about for removing it. Diag.log output:...
3
by: fniles | last post by:
In our ASP page, we call XMLHttp to download XML files. When calling our page using localhost (localhost/myWebSite/myPage.htm), it works, but when calling using the IP address of the web server...
2
by: le0 | last post by:
guys, this is my first time to deploy website to the server, but every time i access the page this error always appears. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.