ADO does not exist in class or namespace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon  Smith via DotNetMonster.com

    ADO does not exist in class or namespace

    Hi all,

    I'm new to C# and am practising the language by writing simple contact
    manager programmes. I'm having a problem using ADO. I'm trying to connect
    to an Access 2000 database using ADO.Net. When compiling I'm getting the
    following error :
    The type or namespace name 'ADO' does not exist in the class or namespace
    'System')are you missing an assembly reference?)

    I've included the 'using System.Data.ADO ' namespace, although when I typed
    the 'using System.Data.' part I only got the classes
    'Common','OleDb ','SqlClient' and 'SqlTypes' in the drop-down list. 'ADO'
    wasn't one of the list options.

    I'm using MS Visual Studio 2002 - 1.0 framework.

    Am I doing somthing wrong?? - PLEASE HELP!!

    Many thanks,
    Jon.

    --
    Message posted via DotNetMonster.c om
    Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

  • Peter van der Goes

    #2
    Re: ADO does not exist in class or namespace


    "Jon Smith via DotNetMonster.c om" <forum@nospam.D otNetMonster.co m> wrote in
    message news:ce305ca933 ee48e3bc40dd7e0 319fef5@DotNetM onster.com...[color=blue]
    > Hi all,
    >
    > I'm new to C# and am practising the language by writing simple contact
    > manager programmes. I'm having a problem using ADO. I'm trying to
    > connect
    > to an Access 2000 database using ADO.Net. When compiling I'm getting the
    > following error :
    > The type or namespace name 'ADO' does not exist in the class or namespace
    > 'System')are you missing an assembly reference?)
    >
    > I've included the 'using System.Data.ADO ' namespace, although when I typed
    > the 'using System.Data.' part I only got the classes
    > 'Common','OleDb ','SqlClient' and 'SqlTypes' in the drop-down list. 'ADO'
    > wasn't one of the list options.
    >
    > I'm using MS Visual Studio 2002 - 1.0 framework.
    >
    > Am I doing somthing wrong?? - PLEASE HELP!!
    >
    > Many thanks,
    > Jon.
    >
    > --
    > Message posted via DotNetMonster.c om
    > http://www.dotnetmonster.com/Uwe/For...sharp/200505/1[/color]

    Are you trying to use ADO or ADO.NET? You seem to be looking for a mix of
    the two, as you refer to some of the ADO.NET classes, yet you say you are
    looking for "ADO".
    If the application you're developing has an interface, try this: use Server
    Explorer to establish a connection to your Access database. Then display the
    tables in Server Explorer and drag a table to your interface. That should
    automatically create an OleDbConnection object for you.
    You may also want to refer to the numerous articles on ADO.NET in your MSDN
    Help, such as ".NET Samples - How To: Data and ADO.NET" and "Accessing Data
    With ADO.NET".

    --
    Peter [MVP Visual Developer]
    Jack of all trades, master of none.


    Comment

    • Jon  Smith via DotNetMonster.com

      #3
      Re: ADO does not exist in class or namespace

      Hi Peter,

      Thanks for replying.

      I'm trying use ADO.Net as I'm using VS.Net. I really want to stick with
      ADO.Net the reason being is I'm actually following the below site's
      information on how to DataBind a textbox to Data.



      It's actually the error message, after compiling, that says 'ADO' and not
      'ADO.Net'. I guess it only says 'ADO' as this is the namespace I've
      entered i.e. using System.Data.ADO

      Various internet sites say exactly what the above is site says in how to
      connect to a database using ADO.Net. Although for some reason a compile
      error occurs when I try.

      Thanks,
      Jon.

      --
      Message posted via DotNetMonster.c om
      Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

      Comment

      • tbain

        #4
        RE: ADO does not exist in class or namespace

        Sounds like you just need to add the "Reference" to System.Data to your
        project. The using statement alone is not enough.
        --
        Thom


        "Jon Smith via DotNetMonster.c om" wrote:
        [color=blue]
        > Hi all,
        >
        > I'm new to C# and am practising the language by writing simple contact
        > manager programmes. I'm having a problem using ADO. I'm trying to connect
        > to an Access 2000 database using ADO.Net. When compiling I'm getting the
        > following error :
        > The type or namespace name 'ADO' does not exist in the class or namespace
        > 'System')are you missing an assembly reference?)
        >
        > I've included the 'using System.Data.ADO ' namespace, although when I typed
        > the 'using System.Data.' part I only got the classes
        > 'Common','OleDb ','SqlClient' and 'SqlTypes' in the drop-down list. 'ADO'
        > wasn't one of the list options.
        >
        > I'm using MS Visual Studio 2002 - 1.0 framework.
        >
        > Am I doing somthing wrong?? - PLEASE HELP!!
        >
        > Many thanks,
        > Jon.
        >
        > --
        > Message posted via DotNetMonster.c om
        > http://www.dotnetmonster.com/Uwe/For...sharp/200505/1
        >[/color]

        Comment

        • Jon  Smith via DotNetMonster.com

          #5
          RE: ADO does not exist in class or namespace

          Hi Thom,

          Thanks for replying.

          I thought of that and looked to see if I could add the reference. I right
          mouse clicked on the project - clicked 'add reference' - but I couldn't
          find a reference for ADO(being in VS.net a reference for ADO.net). Did I
          go about this in the right way? Do I have to import the dll to the
          references or should it already be there?

          Thanks,
          Jon.

          --
          Message posted via DotNetMonster.c om
          Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

          Comment

          • Jon  Smith via DotNetMonster.com

            #6
            RE: ADO does not exist in class or namespace

            Thom,

            I'm not sure if I understand what you mean but ading a reference so I can
            use 'using System.Data;' wouldn't the problem because I'm already using
            other classes of the 'System.Data' namespace. It is the particular 'using
            System.Data.ADO ;' statement that the compiler doesn't like. Infact the
            'ADO' part of the 'using System.Data.ADO ;' is underlined in blue indicating
            some error.

            Thanks again,
            Jon.

            --
            Message posted via DotNetMonster.c om
            Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

            Comment

            • tbain

              #7
              RE: ADO does not exist in class or namespace

              I should have paid more attention. There is no namespace "System.Data.AD O". I
              believe that "System.Dat a" is all you should need. There should be plenty of
              examples on MSDN or Google to show you what you need. Hope this helps.
              --
              Thom


              "Jon Smith via DotNetMonster.c om" wrote:
              [color=blue]
              > Thom,
              >
              > I'm not sure if I understand what you mean but ading a reference so I can
              > use 'using System.Data;' wouldn't the problem because I'm already using
              > other classes of the 'System.Data' namespace. It is the particular 'using
              > System.Data.ADO ;' statement that the compiler doesn't like. Infact the
              > 'ADO' part of the 'using System.Data.ADO ;' is underlined in blue indicating
              > some error.
              >
              > Thanks again,
              > Jon.
              >
              > --
              > Message posted via DotNetMonster.c om
              > http://www.dotnetmonster.com/Uwe/For...sharp/200505/1
              >[/color]

              Comment

              • Jon  Smith via DotNetMonster.com

                #8
                RE: ADO does not exist in class or namespace

                Hi guys,

                I've just been looking on the web for articles on connecting to a database
                using ADO.Net. Some examples are showing the 'using System.Data.ADO ;'
                namespace at the top of the code and other examples are not showing this
                namespace. When I have used this namespace I get a compile error.
                Is there such a namespace as 'using System.Data.ADO ;'
                Someone please help? or please provide a link, with an example that works,
                for DataBinding to textboxes using ADO.Net??

                Many thanks,
                Jon.

                --
                Message posted via http://www.dotnetmonster.com

                Comment

                • Bjorn Abelli

                  #9
                  Re: ADO does not exist in class or namespace


                  "Jon Smith via DotNetMonster.c om" wrote...
                  [color=blue]
                  > I've just been looking on the web for articles on connecting
                  > to a database using ADO.Net. Some examples are showing the
                  > 'using System.Data.ADO ;' namespace at the top of the code
                  > and other examples are not showing this namespace.[/color]

                  The example you provided a link to says that it used the *beta* version of
                  ..NET.

                  If that namespace existed in the beta, it never made it to the final
                  release.

                  Instead you should use System.Data.Ole Db instead of System.Data.ADO , and
                  subsequently the classes OleDB*, instead of ADO*.

                  // Bjorn A






                  Comment

                  • Bjorn Abelli

                    #10
                    Re: ADO does not exist in class or namespace


                    "Jon Smith via DotNetMonster.c om" wrote...
                    [color=blue]
                    > I've just been looking on the web for articles on connecting
                    > to a database using ADO.Net. Some examples are showing the
                    > 'using System.Data.ADO ;' namespace at the top of the code
                    > and other examples are not showing this namespace.[/color]

                    The example you provided a link to says that it used the *beta* version of
                    ..NET.

                    If that namespace existed in the beta, it never made it to the final
                    release.

                    Instead you should use System.Data.Ole Db instead of System.Data.ADO , and
                    subsequently the classes OleDB*, instead of ADO*.

                    // Bjorn A






                    Comment

                    • Jon  Smith via DotNetMonster.com

                      #11
                      Re: ADO does not exist in class or namespace

                      Hi Bjorn,

                      Thanks for your help. I really appreciate it.

                      Jon.

                      --
                      Message posted via DotNetMonster.c om
                      Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

                      Comment

                      • Jon  Smith via DotNetMonster.com

                        #12
                        Re: ADO does not exist in class or namespace

                        Hi Bjorn,

                        Thanks for your help. I really appreciate it.

                        Jon.

                        --
                        Message posted via DotNetMonster.c om
                        Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.

                        Comment

                        Working...