Missing sqlconnect in toolbox. RRS feed

  • Question

  • Hey I'm trying to learn how to connect a database to a C# project. The
    tutorial I am trying to follow says to do the following:

    Creating a Database Connection
    The first thing you need when retrieving data from a database is, of
    course, a database connection. Although you can use the Data Adapter
    Configuration Wizard to create a new database connection, the process
    is easier to understand if you do it yourself the first time. To do
    so, start a new Windows Application project, open the Toolbox window,
    and drag a new SqlConnection object onto the form.



    The only problem I have is that my toolbox does not have a
    Sqlconnection object. I can't seem to find it.
    This is very frustrating!

    I am using Visual Studio 2005 Professional Edition.

    Can anyone help?

    Friday, March 21, 2008 3:10 PM


  • you don't need that, just type

    SqlConnection conn = new SqlConnection(string connectionString);

    here are some examples of connection strings:




    go to data section on your toolbox, right click on it and choose "choose items", choose tab .net framework components,

    scroll down and find sqlconnection Smile

    Friday, March 21, 2008 3:14 PM