Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.1
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 October 31st, 2005, 11:28 PM
Authorized User
 
Join Date: Jan 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't run a website with an application done in MS

Hi Guys! I have came this far with my first web application just to be stopped at the provider door step. Please help me get through if you can.

I have build my first web application according on your ASP.NET 1.1 with VB.NET 2003 and it runs fine in Visual Studio but when I have uploaded all the files from project called Resume2 to the wwwRoot directory of “www.henrysresume.com” at my provider site and access the site from internet I am getting the error below:

Parser Error Message: Could not load type 'Resume2.Global'.

Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="Resume2.Global" %>

Source File: C:\Accounts\henrysre\wwwRoot\global.asax Line: 1

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300


However, the Globa.asax file code doesn’t have a code line outlined in the Error message. Below is the page’s code.

Imports System.Web
Imports System.Web.Security
Imports System.Web.SessionState
Imports System.Data.OleDb

Public Class Global
    Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Component Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Required by the Component Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Component Designer
    'It can be modified using the Component Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        components = New System.ComponentModel.Container
    End Sub

#End Region

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

        Application("iVisitCur") = 0

    End Sub

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the session is started
        Session("FullRegistry") = False


        'Declare the database access objects
        Dim UsersDr As OleDbDataReader
        Dim UsersConn As OleDbConnection
        Dim UsersCmd As OleDbCommand
        'Declare the connection string that grants access to the database
        Dim Conn As String = ConfigurationSettings.AppSettings("ConnectionStrin g")
        'Declare the SQL that will be executed. tblApplicLog AplTotVisits
        Dim SQL As String = "SELECT AplTotVisits FROM tblApplicLog"
        'Open the connection to the database.
        UsersConn = New OleDbConnection(Conn)
        UsersCmd = New OleDbCommand(SQL, UsersConn)
        UsersConn.Open()
        UsersDr = UsersCmd.ExecuteReader(CommandBehavior.CloseConnec tion)

        If UsersDr.Read Then
            Application("iVisitTot") = UsersDr("AplTotVisits")
            Application("iLastVisitTot") = UsersDr("AplTotVisits")
        End If
        UsersDr.Close()

    End Sub

    Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires at the beginning of each request
    End Sub

    Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires upon attempting to authenticate the use
    End Sub

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when an error occurs
    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the session ends
        Application("iVisitCur") = Application("iVisitCur") - 1
        If Application("iVisitCur") < 0 Then Application("iVisitCur") = 0
    End Sub

    Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the application ends
        Dim queryString As String
        Dim data As New DataSet
        Dim dbConnection As OleDbConnection
        Dim dataAdapter As OleDbDataAdapter
        Dim connectionString As String = ConfigurationSettings.AppSettings("ConnectionStrin g")
        queryString = "SELECT * FROM tblApplicLog"
        dbConnection = New OleDbConnection(connectionString)
        dataAdapter = New OleDbDataAdapter(queryString, dbConnection)

        dataAdapter.Fill(data, "tblApplicLog")

        Dim table As DataTable
        table = data.Tables("tblApplicLog")

        Dim selectedRows() As DataRow
        'selectedRows = table.Select("Pass = '" & sPassword & "'")

        selectedRows(0).Item("AplTotVisits") = Application("iVisitTot")

        'generate the Update command
        Dim commandBuilder As OleDbCommandBuilder

        commandBuilder = New OleDbCommandBuilder(dataAdapter)
        dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand

        'Update the data store
        dataAdapter.Update(data, "tblApplicLog")
        dbConnection.Close()
    End Sub

End Class


I have tried to get some advice from the provider’s support staff but the best they could offer was to “troubleshooting the application code for errors”.
Could you give me direction how to correct this problem keeping in mind that this is first web application done by ex VB6 programmer.

Many thanks in advance
Henry


 
Old November 1st, 2005, 12:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

I had something like this before; try changing Global class to something else, like Global2, then change the reference in @Application to Inherits="Resume2.Global2" and see if that solves the problem.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
my website working but its down coz ms sql naeem.net ASP.NET 2.0 Professional 5 October 10th, 2008 03:45 PM
CONVERSION FROM WEBSITE APPLICATION TO WEB APPLICA msathyaprasad90 ASP.NET 2.0 Professional 0 January 24th, 2007 03:16 AM
MS Data Grid control in ms access application roshla_p Access VBA 5 October 16th, 2006 02:37 AM
Can't run a website with an application done in Vi hchlebowski VB.NET 2002/2003 Basics 1 November 4th, 2005 11:35 AM
MS Access db on a website lawrenceh VB Databases Basics 0 September 25th, 2004 06:32 PM





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