Hello all,
I am trying to connect to a mySQL db using vb.net. I have been unsuccesful. In addition to this, I am growing increasing frustrated at the fact that there is little documentation on this. SOMEONE please help. HOW do you get ASP.NET(VB) and mySQL to work? I have download the odbc driver 3.51, I have a valid connection string and still nothing. Here is my code so far:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data.Odbc" %>
<script runat="server">
Dim MyConnString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=localhost;" & _
"DATABASE=dscimedia;" & _
"UID=root;" & _
"PASSWORD=visionary;" & _
"OPTION=3;"
Dim mySelectQuery As String = "SELECT * FROM general_generaltopics"
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
myConnection.Open()
myConnection.Close()
Response.Write("It worked")
</script>
I can not get this to work.
I am trying to connect to a mySQL db using vb.net. I have been unsuccesful. In addition to this, I am growing increasing frustrated at the fact that there is little documentation on this. SOMEONE please help. HOW do you get ASP.NET(VB) and mySQL to work? I have download the odbc driver 3.51, I have a valid connection string and still nothing. Here is my code so far:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data.Odbc" %>
<script runat="server">
Dim MyConnString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=localhost;" & _
"DATABASE=dscimedia;" & _
"UID=root;" & _
"PASSWORD=visionary;" & _
"OPTION=3;"
Dim mySelectQuery As String = "SELECT * FROM general_generaltopics"
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
myConnection.Open()
myConnection.Close()
Response.Write("It worked")
</script>
I can not get this to work.