How to import a namespace?

Posted on 2006-03-27
Last Modified: 2013-11-19
I need to import the MySql.Data.MySqlClient namespace in 2003. I've installed Connector/Net 1.0.

How do I do this?
Question by:bjqrn
    LVL 11

    Accepted Solution

    Just add

    using namespace MySql::Data::MySqlClient;

    to the top of you C++ code..
    LVL 3

    Author Comment

    This is what I get:

    i:\projects\rpg\rpgserver\rpgserver.cpp(6) : error C2653: 'MySql' : is not a class or namespace name
    i:\projects\rpg\rpgserver\rpgserver.cpp(6) : error C2871: 'MySqlClient' : a namespace with this name does not exist
    LVL 3

    Author Comment

    Found it out, had to place the MySQL.Data.DLL in my Debug/Release directory then put managed extensions option on, then write this code:

    #using "MySql.Data.dll"
    using namespace MySql::Data::MySqlClient;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
    This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now