System.Data.sqlClient Class Compile Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Abbey Gwayambadde

    System.Data.sqlClient Class Compile Error

    I have a simple function that is supposed to import the
    System.data.sql Client class but it keeps saying during the compiling that
    the class cannot be found.

    Error is: BC30466: Namespace or type 'data' for the Imports 'System.Data'
    cannot be found.
    It then underlines the System.data section of the Imports declaration. The
    code for my .vb file is below.

    ' estoreDataLayer .vb
    '
    Imports System
    Imports System.Data


    Namespace estore

    Public Class dataLayer
    Public Sub New()

    End Sub

    Public Shared Function getDataReader( _
    byVal sqlString As String) As sqlDataReader

    dim myReader As sqlDataReader
    dim myCommand As new sqlCommand()

    with myCommand
    .Connection = New sqlConnection(d ataLayer.connSt ring())
    .connection.ope n()

    .CommandText = sqlStatement
    myReader = .ExecuteReader( CommandBehaviou r.CloseConnecti on)
    End with

    Return myReader
    End Function
    End Class
    End Namespace


  • Herfried K. Wagner [MVP]

    #2
    Re: System.Data.sql Client Class Compile Error

    Hello,

    "Abbey Gwayambadde" <Abbey@centrixg roup.net> schrieb:[color=blue]
    > I have a simple function that is supposed to import the
    > System.data.sql Client class but it keeps saying during
    > the compiling that the class cannot be found.
    >
    > Error is: BC30466: Namespace or type 'data' for the
    > Imports 'System.Data' cannot be found.
    > It then underlines the System.data section of the Imports declaration. The
    > code for my .vb file is below.[/color]

    Are you sure a reference to "System.Data.dl l" is set?

    Regards,
    Herfried K. Wagner
    --
    MVP · VB Classic, VB.NET
    Die Website von H. Wagner zu .NET, Visual Basic .NET und Classic Visual Basic.



    Comment

    • Abbey Gwayambadde

      #3
      Re: System.Data.sql Client Class Compile Error

      I am not sure how to check to see if system.data is referenced. In my
      many infinit tries, I have also discovered the on complilation, the
      system namespace compiles fine, so does the system.IO clas but
      system.Net give the same "not found" error. HOWEVER, all my applications
      that reference these codes inline(Asp.net) using a <%@ Import
      namespace="syst em.data" %> work without an error. The problem seems to
      lie in the vbc.exe compilor program loading the class.

      I hope this helps with your trying to help me.

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: System.Data.sql Client Class Compile Error

        "Abbey Gwayambadde" <abbey@centrixg roup.net> schrieb:[color=blue]
        > I am not sure how to check to see if system.data is
        > referenced. In my many infinit tries, I have also discovered
        > the on complilation, the system namespace compiles fine,
        > so does the system.IO clas but system.Net give the same
        > "not found" error. HOWEVER, all my applications
        > that reference these codes inline(Asp.net) using a <%@ Import
        > namespace="syst em.data" %> work without an error.
        > The problem seems to lie in the vbc.exe compilor program
        > loading the class.[/color]

        You may want to turn to the ng for ASP.NET questions:

        news://msnews.microsoft.com/microsof...amework.aspnet

        Web interface:



        --
        Herfried K. Wagner
        MVP · VB Classic, VB.NET
        Die Website von H. Wagner zu .NET, Visual Basic .NET und Classic Visual Basic.



        Comment

        Working...