CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Base Class

  1. #1
    Join Date
    Apr 2008
    Posts
    5

    Base Class

    If I create a base class for my pages which will open my Database connection, load user data etc. Can I also define commonly used imports files in this class, when I do this currently it doesn't reference them

    Imports Microsoft.VisualBasic
    Imports System.Data
    Imports System.Data.SqlClient
    Imports database ' Class that would be used by child page

    Public Class BasePage
    Inherits System.Web.UI.Page

    Private _Conn As SqlConnection

    Public ReadOnly Property Conn() As SqlConnection
    Get
    If _Conn Is Nothing Then
    _Conn = Utility.GetConnection
    End If
    Return _Conn
    End Get
    End Property


    End Class

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Base Class

    Imports is usually only applicable to the module in which it is written.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured