Click here to Skip to main content
13,049,814 members (71,936 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi, I need help on the codes to connect mysql database(mysherpherd) to a visual basic project I created in Visual Studio 2010. At the moment I have created all the interfaces and their respective properties. My intention is to store information about my church members. thank
Posted 29-Apr-13 11:00am
ThePhantomUpvoter 29-Apr-13 17:09pm
And your question/problem is what exactly?
Sergey Alexandrovich Kryukov 29-Apr-13 17:13pm
Way too vague...
JOE MIS 29-Apr-13 21:16pm
post some example of ur code so everyone can see it and i'll give u some solution...
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


For connecting to the any database(DBMS) in .NET you can use ADO.NET so for this purpose first of all you need a connection string after that for using a connection string you need a connection object. For sql server you can use SqlCilent library and for other database same as MySql you can use Odbc library from .NET follow of codes illustrate it.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ConnectionString As String = "Driver={MySQL};SERVER=.;DATABASE=NorthwindMySQL;" '
Dim conn As New OdbcConnection(ConnectionString)
Dim dataAdap As New OdbcDataAdapter("SELECT CustomerID, ContactName, ContactTitle FROM Customers", conn)
Dim dataset As New DataSet("Cust")
dataAdap .Fill(dataset , "Customers")
MyGrid.DataSource = dataset.DefaultViewManager
End Sub 'Form1_Load

Fro more information please check the:[^]
and for get more information about connection strings check it:[^]

Best Regards.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I don`t know why you give this solution because I did it in my solution before you! please check my solution before than give a new solution ;)
"more information about connection strings check it:[^]"
Best Regards.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100