ASP.NET Computer forum-Message page code


Computer forum-Message page code


<%@ Page Language="vb" AutoEventWireup="true" %>
<%@ Import Namespace ="System.Data" %>
<%@ Import Namespace ="System.Data.Oledb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
<style type="text/css">
height: 212px;
<form id="form1" runat="server">
<h4 style="background-color: #CCCFFF">Question:</h4>
<asp:TextBox ID="txtq" TextMode="MultiLine" runat ="server" Height="214px" Width="600px" />
<asp:Button ID="Submit" runat="server" Text="Add a Reply to this Question"
Width="194px" OnClick="Addreply"/>
<asp:Button ID="bntanswer" runat="server" Text="View Answers" Width="148px" OnClick="viewanswer" />

<script runat="server">

Dim cn As OleDb.OleDbConnection

Dim ds As New DataSet

Dim ad As OleDb.OleDbDataAdapter

Sub Page_Load

If Not Page.IsPostBack Then


End If

End Sub

Sub show(ByVal sender As Object, ByVal e As System.EventArgs)

cn = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & MapPath("dbthreads.accdb"))


ad = New OleDb.OleDbDataAdapter("Select * From tblthread Where threadid=" & CInt(Request.QueryString("threadid")), cn)

ad.Fill(ds, "tblthread")

txtq.Text = ds.Tables(0).Rows(0)(4).ToString()


End Sub

Sub Addreply(ByVal sender As Object, ByVal e As System.EventArgs)

Response.Redirect("Reply.aspx?threadid=" & Request.QueryString("threadid"))

End Sub

Sub viewanswer()

Response.Redirect("Answers.aspx?threadid=" & Request.QueryString("threadid"))

End Sub



couldn't connect to server