Results 1 to 5 of 5

Thread: MySql question

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    MySql question

    How do I connect to a mysql database thats on a server? Im using vb .net 2005. Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: MySql question

    See www.connectionstrings.com for all manner of connection string formats, including the one you want.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: MySql question

    Do I need to use a special control?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: MySql question

    There are no controls involved. Controls are UI elements.

    You use the standard ADO.NET methodology using a data namespace that can access MySQL. You can use System.Data.Odbc, which is part of the .NET Framework, or you can use a third-party library that is designed specifically for MySQL. I'd suggest the latter, and there is such a library available free from MySQL themselves.

    Once you've decided on the namespace you perfrom the standard ADO.NET operations. If you use the MySQL library you'll be using a MySqlConnection, MySqlDataAdapter, etc. I'd suggest that you read some ADO.NET tutorials to get the basic principles. Any tutorial will do as the principles are the same no matter the data source. For instance, you can read the tute from fellow member TechGnome's signature. It's designed for SQL Server but all you have to do is change SqlConnection to MySqlConnection, etc., get the right connection string format and you're away.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: MySql question

    Thanx for the info, you are the man

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width