ok, im trying to make a web app using asp.net and vb, what im doing is i have a mysqldatareader reading the database and writing links to the page, what i want to do is when the link is clicked, i want it to grab the data that is associated with the links row in the database and post it on a new page, here is my code, any help would be tremendous
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<a href = "courseinput.aspx">Input</a>
<%
%>
<form id="form1" runat="server">
<div>
Current Courses as of
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
<br />
</div>
<% Dim connection As New MySql.Data.MySqlClient.MySqlConnection("Data Source=localhost;Database=sigma;User ID=root;Password=root") 'Provide the connection string to your database
Dim cmd As MySql.Data.MySqlClient.MySqlCommand
cmd = New MySql.Data.MySqlClient.MySqlCommand
cmd.CommandText = "select course from course;"
connection.Open()
cmd.Connection = connection
Dim reader As MySql.Data.MySqlClient.MySqlDataReader = cmd.ExecuteReader
%>
'this is where the links are posted to the page by the reader
<% While reader.Read%>
<ul>
<li><a href = "#"><%Response.Write(reader(0))%></a></li>
</ul>
<%End While%>
</form>
</body>
</html>
Comment