CrazyEngineers
  • connecting to mysql database from visual studio

    rohitvishnu

    Member

    Updated: Oct 26, 2024
    Views: 1.1K
    hi
    how do i connect to a mysql database from visual studio 2008? i'm not able to create an odbc data source either, as there is no driver installed for it.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • slashfear

    MemberApr 23, 2009

    Hi Rohit,

    You can either use ODBC or MySql Client for .NET.
    1. Download MySql Client dll.​
    2. Add the dll to your project.​
    3. Add connection string to web.config​
    <connectionStrings>
    <add name="Connstring" connectionString="server=localhost; userid=uid;password=pwd;pooling=yes;Database=DB" providerName="MySql.Data.MySqlClient"/>
    </connectionStrings>
    <system.data>
    <DbProviderFactories>
    <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5.0.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
    </DbProviderFactories>
    </system.data>​
    That's it you can follow same sqlclient connection.​



    And you can have a look at this detailed tutorial and you can download the plugins from the below link: #-Link-Snipped-#

    Hope this helps!!!! :smile:
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register