Results 1 to 3 of 3

Thread: deriving classes in .net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    67

    deriving classes in .net

    Hi People,

    Having some problems using inheritance in vb.net. Maybe you can help. Im trying to use the base class (oleDbConn) within another class. The error im getting states i can't use more than one class? do i need to use module? how do u use classes.

    Thanks In Advance

    'Base Class

    Imports System
    Imports System.Data
    Imports System.Data.OleDb
    Imports Microsoft.VisualBasic

    Public Class oleDbConn
    Public Shared Sub Main()


    Dim dbase As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\helpdesk.mdb;")
    Dim faultsDAdapter As New OleDbDataAdapter("Select * from faults", dbase)
    Dim faultsDSet As DataSet = New DataSet()

    End Sub
    End Class

    'class im getting errors from.

    Public Class administration
    Inherits System.Windows.Forms.Form

    Inherits class2

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    a class can only inherit 1 class...you are trying to inherit 2 classes
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    67
    Thanks Chris, maybe u can explain how i should use classes then.

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