Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. vb.net 2005 Connecting to MySQL 5 [modified]

vb.net 2005 Connecting to MySQL 5 [modified]

Scheduled Pinned Locked Moved Visual Basic
databasequestioncsharpmysql
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mbire
    wrote on last edited by
    #1

    Hi guys, I am writing a system that should connect to varied database systems (currently MS SQL 2000, 2005 and MySQL). I decided to use Oledb.net provider for my connections. For the different versions of MSSQL it works fine but I am having a problem trying to run commands on MySQL connection. I got the following connection string from the net Dim myCommand As New OleDbConnection("Provider=MySqlProv.3.0;Data Source=th911;User Id=root;password=root") From my analysis of the connection string there is no database name (Initial Catalog). How then does MySQL know the database i am interested in or how can i make it known without having to enter the credentials every time i open the connection? Thanks for your assistance guys.:(( -Mbire- I can resist everything else except temptation... -- modified at 8:24 Monday 10th September, 2007

    P 1 Reply Last reply
    0
    • M Mbire

      Hi guys, I am writing a system that should connect to varied database systems (currently MS SQL 2000, 2005 and MySQL). I decided to use Oledb.net provider for my connections. For the different versions of MSSQL it works fine but I am having a problem trying to run commands on MySQL connection. I got the following connection string from the net Dim myCommand As New OleDbConnection("Provider=MySqlProv.3.0;Data Source=th911;User Id=root;password=root") From my analysis of the connection string there is no database name (Initial Catalog). How then does MySQL know the database i am interested in or how can i make it known without having to enter the credentials every time i open the connection? Thanks for your assistance guys.:(( -Mbire- I can resist everything else except temptation... -- modified at 8:24 Monday 10th September, 2007

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Mbire wrote:

      How then does MySQL know the database i am interested in or how can i make it known without having to enter the credentials every time i open the connection?

      You will need to specify the database name. http://www.connectionstrings.com[^] has many different database connection strings that you might find helpful.

      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups