Connecting to a sql server database

From: Irishmaninusa (jdaly_at_structuctureinteractive.com.takemeoffifyouwantoemailme)
Date: 09/13/04


Date: Mon, 13 Sep 2004 12:33:32 -0400


I have a client who is trying to connect to a sql server database using
asp.net and this is the error message that they get, any ideas on what is
causing the error message and what the correction for this.

Code they are using

<%@ Page Language="VB" Debug="true" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<body>

<%

Dim Conn As SqlConnection = New SqlConnection()
Conn.ConnectionString = "Provider=SQLOLEDB;Data Source=blah;Initial
Catalog=blah;user id=blah;password=blah2;"
Conn.Open()

Dim cmdSelectSpecies as SqlCommand
Dim species_result as SqlDataReader

cmdSelectSpecies = New SqlCommand("SELECT SpeciesName FROM Species",Conn)
species_result = cmdSelectSpecies.ExecuteReader()
While species_result.Read()
    Response.Write( "<li>" )
    Response.Write( species_result( "SpeciesName" ) )
end While
species_result.close()
Conn.close()
%>
</body>
</html>

Error MEssage
Server Error in '/' Application.
----------------------------------------------------------------------------

----
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for
user 'NT AUTHORITY\NETWORK SERVICE'.
Source Error:
Line 11:                             "Initial Catalog=hekman_contract;" & _
Line 12:                             "Integrated Security=SSPI"
Line 13: Conn.Open()
Line 14:
Line 15:
Source File: c:\inetpub\wwwroot\hekman_contract\test.AW.aspx    Line: 13
Stack Trace:
[SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
   System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
+474
   System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection
(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   ASP.test_AW_aspx.__Render__control1(HtmlTextWriter __output, Control
parameterContainer) in c:\inetpub\wwwroot\hekman_contract\test.AW.aspx:13
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Page.ProcessRequestMain() +1926
----------------------------------------------------------------------------
----
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
-- 
J.Daly
structure:interactive
Ph: 616-364-7423
Fx: 616-364-6941
http://www.structureinteractive.com


Relevant Pages

  • Re: Opening Word multiple time with linked text file
    ... >stored in a SQL Server database that changes earch time the report is run. ... >I get the following error message. ... >The Microsoft Jet database engine cannot open the file 'tmpLegal.txt'. ...
    (microsoft.public.access.externaldata)
  • Re: Write conflict
    ... If this is a SQL Server database and you have a Bit field in your table, ... Roger dot Carlson at Spectrum-Health dot Org ... > I get the following error message when i do an edit on a database i am ... > Copy to clipboard or Drop Changes (The save record option is greyed out) ...
    (microsoft.public.access.forms)
  • Re: Can not connect to SQL Server database with http://Localhost
    ... I tried using your connection string, but still got an error message: ... Invalid character ... Jeffrey ... Re: Can not connect to SQL Server database with http://Localhost ...
    (microsoft.public.sqlserver.connect)
  • Re: linked tables
    ... Yes, when I try to access the linked table, I get this error message: ... Microsoft OLE DB Provider for ODBC Drivers ... I don't know whether your SQL Server database requires a user ID and password for access, ...
    (microsoft.public.vb.database.ado)
  • Image Data - Lost Connection, any Size Limit?
    ... I am using a ADO's Keyset Recordset to upload binary ... files into a SQL server database, ... the error message I got is ... Check your network documentation" ...
    (microsoft.public.sqlserver.programming)