Click here to Skip to main content
13,255,340 members (49,107 online)
Click here to Skip to main content
Add your own
alternative version


19 bookmarked
Posted 30 Jan 2007

Connecting ASP.NET and MySQL

, 30 Jan 2007
Rate this:
Please Sign up or sign in to vote.
Connecting ASP.NET and MySQL


This article demonstrates the connection between between ASP.NET and MySQL.


Imports System.Data
Imports System.Data.Odbc

Partial Class connstring
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim ConnStr As String = "Server=serverip;Provider=MySQLProv;Driver={MySQL ODBC 3.51 Driver};Database=databasename;uid=username;pwd=password"
Dim conn As New Odbc.OdbcConnection(ConnStr)
Dim olecmd As New Odbc.OdbcCommand("select * from Activity", conn)
Dim reader As Odbc.OdbcDataReader
reader = olecmd.ExecuteReader
While reader.Read
Response.Write(reader("Name") & "<br>")
End While

End Sub
End Class


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Mathew G Sujith
Web Developer
India India
Currently working as Web Programmer in

Vanilla Networks,Technopark,Trivandrum

You may also be interested in...

Comments and Discussions

GeneralConnector/Net Pin
Stanislav Panasik30-Jan-07 4:48
memberStanislav Panasik30-Jan-07 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171114.1 | Last Updated 30 Jan 2007
Article Copyright 2007 by Mathew G Sujith
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid