Wrox Programmer Forums
|
BOOK: Beginning ASP.NET Databases Also see the forum ASP Databases for more general discussions of ASP database issues not directly related to these books.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2003, 12:00 PM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server Error in '/' Application

Data link properties

Server name: FILCAN
Enter information to log on to the server:Use [u]W</u>indows NT Integrated security
Attach a database file as a database name:
Using the filename:C:\Program Files\Microsoft SQL Server\MSSQL\Data\Northwind.mdf

Test connection succeeded

and I got this error message.

SQL Server does not exist or access denied.
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: SQL Server does not exist or access denied.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +472
   System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +311
   System.Data.SqlClient.SqlConnection.Open() +383
   ASP.SQLServer_connection_aspx.Page_Load(Object Source, EventArgs E) +72
   System.Web.UI.Control.OnLoad(EventArgs e) +55
   System.Web.UI.Control.LoadRecursive() +27
   System.Web.UI.Page.ProcessRequestMain() +731

And I have these code
%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">

    Sub Page_Load(Source As Object, E As EventArgs)
        Dim strConnection As String = "server=(local)\netSDK database=Nortwind; " & _
                        "integrated security=true;"
        Dim objConnection As New SqlConnection(strConnection)

        Dim strSQL As String ="SELECT Firstname, LastName, Country " & _
                     "FROM Employees"
        Dim objCommand As New SqlCommand (strSQL, objConnection)

        objConnection.Open()
        dgNameList.DataSource = objCommand.ExecuteReader()
        dgNameList.Databind()
        objConnection.Close()
    End sub

</script>
<html>
<head>
    <title>Beginning ASP.NET Databases Chapter 3</title>
</head>
<body>
    <h4>First Example: Listing data from the Employees table
    </h4>
    <asp:DataGrid id="dgNamelist" runat="server" GridLines="None" BackColor="LightBlue" Cellpadding="5" BorderWidth="2" BorderColor="Black" ToolTip="Includes only those employees who are at HQ"></asp:DataGrid>
</body>

<script language="JavaScript">
<!--

window.open = SymRealWinOpen;

//-->
</script>

</html>

web.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.web>
        <customErrors mode="Off" />
        <compilation debug="true" />
    </system.web>
    <appSettings>
        <add key="NWind" value="server=(local)\netSDK database=Northwind; integrated security=true" />
    </appSettings>
</configuration>

 I have no problem connection with Access OLE DB Access_connection.asp and Schema.aspx please help me to solve my problem I just skipped the SQL Server connection because I can't connect it. And I moved on to chapter 4 I got the same problem datareader.aspx

Thank you in advance




 
Old August 11th, 2003, 10:08 AM
Authorized User
 
Join Date: Jun 2003
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

The user is facing problem because of incorrect settings in web.config file
for both chapter 3 and chapter 4. I am sending the correct web.config file
as an attachment with this mail. Please pass it to the customer.

The customer also needs to copy this file in chapter 4 folder, if this file
is missing there.

There is one more possibility of this error, Please make sure that your have
MSDE installed on your system with the instance named "NetSDK". If the
instance name is different on the user machine, the respective changes are
required in the web.config file and also in the connection string.

Jennifer D. Taylor
Wiley Technical Support
 
Old August 12th, 2003, 09:07 AM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jdtaylor,

  Thank you very much to your reply, I'll wait for your correct web.config file and I will pass it to the customer.

amonastrial

 
Old November 8th, 2005, 03:07 PM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, Everyone,


I have a problem on the book chapter 12 from Beginning ASP.NET Databases using C#.
I ran the Databasesetup.sql thruogh Query Analyzer on Windows 2000 SQL Server.

My problem is that when I create the user name from register.aspx and hit create button.
I copied the web.config file and modified connection and put it under Bid_cs directory.
I got an error from

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

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'FormatUrl' does not exist in the current context

Source Error:



Line 29: <asp:TemplateColumn HeaderText="Item Name - Click to Complete purchase.">
Line 30: <ItemTemplate>
Line 31: <asp:hyperlink id="hypItemName" NavigateUrl= '<%# FormatUrl(DataBinder.Eval(Container.DataItem, "ItemID"), DataBinder.Eval(Container.DataItem, "Highestbid")) %>' Text='<%# DataBinder.Eval(Container.DataItem, "ItemName") %>' Runat="server" />
Line 32: </ItemTemplate>
Line 33: </asp:TemplateColumn>


Source File: c:\c-sharp\7418\7418BegASPNETdbCS\webroot\ch12\Bid_cs\M enuForregisteredUsers.aspx Line: 31


Can you help me?
I feel that web.config has a problem or something else.


Thanks!

Joe Cho
[email protected]




Quote:
quote:Originally posted by jdtaylor
 Hi,

The user is facing problem because of incorrect settings in web.config file
for both chapter 3 and chapter 4. I am sending the correct web.config file
as an attachment with this mail. Please pass it to the customer.

The customer also needs to copy this file in chapter 4 folder, if this file
is missing there.

There is one more possibility of this error, Please make sure that your have
MSDE installed on your system with the instance named "NetSDK". If the
instance name is different on the user machine, the respective changes are
required in the web.config file and also in the connection string.

Jennifer D. Taylor
Wiley Technical Support
Joe Cho





Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Application Error Picabrillo BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 12 May 16th, 2006 06:08 AM
Server Error in '/' Application jamesbie ASP.NET 1.0 and 1.1 Basics 2 October 18th, 2005 05:35 AM
Server Application Error cis BOOK: Beginning ASP.NET 1.0 2 February 12th, 2004 06:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.