Results 1 to 5 of 5

Thread: [RESOLVED] hello

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Resolved [RESOLVED] hello

    Hi,

    How do you go about creating a connection to a mysql database ?

    Can this be done with the use of ini files etc ? so if conections change a file can be modified rather than the program update.

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

    Re: hello

    You can use OleDb to connect to MySQL, or you may prefer to get a MySQL-specific data connector. There is a link to one in my signature.

    The ConnectionString property of any ADO.NET connection is a dynamic property, which means that it has in-built support to be read from the application config file. Edit the DynamicProperties section in the properties window for the connection and it will be automatically stored in the config file, which will be created if necessary, and then read at run time without further intervention. You can then edit the config file by hand at each installation as it's just XML.

    Finally, can I recommend more descriptive thread titles in future. You'll notice that most give an indication of what the thread is about.
    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
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Re: hello

    My appologies,

    I will remember this for next time thanks, You mention using the MySQL -specific data conector and then in the paragraph you talk about ado do i use both or just one ?

    I was wondering if you could help me as well i have downloaded the 101 samples from you sig but they are saying they are missing files and can not open
    Last edited by bach; Nov 3rd, 2005 at 04:30 AM.

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

    Re: hello

    ADO.NET is the preferred method of data access for .NET applications. The MySQL data connector implements the same interfaces as all the data connectors that are included in the .NET Framework, so it IS ADO.NET. For instance, the OleDbConnection, SqlConnection, OracleConnection and OdbcConnection classes included in the .NET Framework all implement the IDbConnection interface, as does the MySqlConnection that comes with the library I recommended. You can basically use any ADO.NET example for any Data namespace and simply substitute the corresponding classes from the appropriate namespace. You may also like to visit www.connectionstrings.com for the appropriate connection string. Make sure you use the correct one for the connector you are using.

    With regards to the 101 samples, are you sure you downloaded the correct version? I've never had an issue opening one and I'm not aware of anyone else who has either. You should be opening the SLN files.
    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
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Re: hello

    thanks

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