Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2005, 01:15 PM
Authorized User
Join Date: Jan 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't run a website with an application done in Vi

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 based on the ‘Beginning 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()

        'This call is required by the Component Designer.

        '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)
        UsersDr = UsersCmd.ExecuteReader(CommandBehavior.CloseConnec tion)

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

    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")
    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

Reply With Quote
  #2 (permalink)  
Old November 4th, 2005, 11:35 AM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

I have an aspx app named WF. In the global asax there is a line . . . Inherits="WF.Global"

Your app appears to be called Resume (guessing). But the line in the aspx is referencing resume2.Global.
Obviously, I have no info on what has gone on, But if I were trouble-shooting, I'd be looking first to see if the development process involved saving the application as Resume2 at some point due to a file-sharing violation or some other problem, leading to needing to save the app under a different name. (This happens to me all the time woth Word [grrrr].

Just a thought.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CONVERSION FROM WEBSITE APPLICATION TO WEB APPLICA msathyaprasad90 ASP.NET 2.0 Professional 0 January 24th, 2007 03:16 AM
How to extract data from webbrowser controle in vi method Visual C++ 0 July 11th, 2006 02:46 PM
How to get info on Website form Win Application?! Awsok VS.NET 2002/2003 0 March 3rd, 2005 11:31 AM
Memory leak in GetInput() function of MSComm in Vi dennis24 Visual C++ 1 August 24th, 2004 09:22 AM

All times are GMT -4. The time now is 04:52 AM.

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