View unanswered posts | View active topics It is currently Sat Jun 25, 2022 9:35 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" %>

<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)
objRdr = objCmd.ExecuteReader()
rpcProductList.DataSource = objRdr
End Sub
<form runat="server">
<table width="100%" border="0" cellspacing="0" cellpadding"10">
<td valign="top" width="160">
<td valign="top">
<h1>Unique Oils Product List</h1>
<asp:Repeater id="rpcProductList" runat="server">
<p>SKU: <strong>
<%# Container.DataItem("SKU") %></strong>

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

Manufacturer Name: <strong>
<%# Container.DataItem("MfgName") %></strong></p>

Tue Nov 14, 2006 9:04 pm
Report this post
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:  
© Copyright 2003-2008 The ultimate PHP Editor and PHP IDE site.