Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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
you.
Posted 29-Apr-13 12:00pm
Comments
ThePhantomUpvoter at 29-Apr-13 17:09pm
   
And your question/problem is what exactly?
Sergey Alexandrovich Kryukov at 29-Apr-13 17:13pm
   
Way too vague...
—SA
JOE MIS at 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
good
Please Sign up or sign in to vote.

Solution 1

Hi
 
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)
conn.Open()
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
conn.Close()
End Sub 'Form1_Load
 
Fro more information please check the: http://sourceforge.net/projects/vb-net-to-mysql/[^]
and for get more information about connection strings check it: http://connectionstrings.com/[^]
 
Best Regards.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
AYDIN EBRAHIMI HOMAY at 30-Apr-13 2:13am
   
Hi
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: http://connectionstrings.com/[^]"
Best Regards.

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



Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2014
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