Click here to Skip to main content
11,920,641 members (56,473 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB10.0
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 12:00pm
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
0 OriginalGriff 548
1 Dave Kreskowiak 245
2 phil.o 170
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web04 | 2.8.151120.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2015
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