View unanswered posts | View active topics It is currently Mon May 23, 2022 10:22 pm



Reply to topic  [ 1 post ] 
 Connecting to Database using MySQL 4.1.12 /VB.Net 
Author Message
Junior Member

Joined: Tue Nov 14, 2006 8:52 pm
Posts: 1
Post Connecting to Database using MySQL 4.1.12 /VB.Net
I am trying to use the VB.Net code below to connect to MySQL database in phpMyAdmin 2.6.4-pl3, but when I view it, it shows nothing.

<%@ Import Namespace="System.Data.OleDB" %>
<%@ Import Namespace="System.Data.ODBC" %>

<html>
<head>
<title>Product List</title>
<script runat="server" language="VB">
Sub Page_Load()
Dim objConn as OleDBConnection
Dim objCmd as OleDBCommand
Dim objRdr as OleDBDataReader
objConn = New OleDbConnection( _
"Provider=MySQLProv;Data Source=products;DB=dbname;USER=myuserid;PASSWORD=mypassword;PORT=3306");
objCmd=New OleDbCommand("SELECT * FROM Products", objConn)
objConn.Open()
objRdr = objCmd.ExecuteReader()
rpcProductList.DataSource = objRdr
rpcProductList.DataBind()
objRdr.Close()
objConn.Close()
End Sub
</script>
</head>
<body>
<form runat="server">
<table width="100%" border="0" cellspacing="0" cellpadding"10">
<tr>
<td valign="top" width="160">
...
</td>
<td valign="top">
<h1>Unique Oils Product List</h1>
<asp:Repeater id="rpcProductList" runat="server">
<ItemTemplate>
<p>SKU: <strong>
<%# Container.DataItem("SKU") %></strong>

Product Name: <strong>
<%# Container.DataItem("ProductName") %></strong>

Manufacturer Name: <strong>
<%# Container.DataItem("MfgName") %></strong></p>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</table>
</form>
</body>


Tue Nov 14, 2006 9:04 pm
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.