Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net connecting to MySQL Server

Status
Not open for further replies.

ICTECH

Technical User
Jun 5, 2002
131
CA
Hi All..


I'm trying to create an App in VB.Net that connects to MySQL for its data. In VB6, I can do this no problems. But in VB.net, nothing but problems.

Am I missing something??



Dim connString As String = "Driver={MySQL ODBC 3.51 Driver};" & _
"SERVER=XXXXXX.org;" & _
"DATABASE=test;" & _
"UID=XXXXXX;" & _
"PASSWORD=XXXX;" & _
"OPTION=16427;"


Dim myConnection As OleDbConnection = New OleDbConnection()
myConnection.ConnectionString = connString

' create a data adapter
Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from Postcatc", myConnection)

' create a new dataset
Dim ds As DataSet = New DataSet()
' fill dataset
da.Fill(ds, "Postcatc")
' write dataset contents to an xml file by calling WriteXml method
' Attach DataSet to DataGrid
DataGrid1.DataSource = ds.DefaultViewManager

 
Figured out what I was doing wrong.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top