View Single Post
  #1 (permalink)  
Old July 21st, 2004, 02:04 AM
shxj99 shxj99 is offline
Registered User
 
Join Date: Jul 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to compile catalog.vb

Hi

The following is my oledb version of catalog.vb for chapter 3. when i use vbc to compile it. the box shows all "oledbXXXXXXs" and "commandbehavior" is not declared.
The command line i type in is like this:

>"c\windows\microsoft.net\framework\v1.1.4322\vbc. exe" /t:library catalog.vb /r:system.web.dll /r:system.dll

Maybe i should reference more assembly?
Any help will be great apperciated

<code>
Imports System
imports system.data.oledb
imports system.configuration


Namespace MyNS

    Public Class catalog
        Public Function GetDepartmets() as OLEDBReader
          Dim NewStrConn as new OLEDBConnection(connectionstring)

          Dim cmd as new OLEDBCommand("getdepartmets",newstrconn)
          cmd.commandtype=commandtype.storedprocedure

          NewStrConn.open()

          return cmd.executereader(CommandBehavior.closeconnection)
        end Function


    Private Readonly Property connectionstring () as string
      Get
        retrun ConfigurationSettings.AppSettings("connectionStrin g")
      End Get
    End Property

    End Class
End Namespace
</code>