XML parsing/ searching

liunx

Guest
Hi I am trying to creat a script that brings in from an xml page. questionid, categoryid, question, answerid, answer.

but i am new to the asp.net business and need bit of help i have started a script but think i am totally wrong in what i am trying to do.

<%@ Import Namespace="System.Data" %>
<script runat="server">
sub Page_Load(sender as Object, e as EventArgs)
dim myknowledgebase=New DataSet
myknowledgebase.ReadXml(Server.MapPath("knowledgebase.xml"))
rb.DataSource=myknowledgebase
rb.QuestionID="QuestionID"
rb.CategoryID="CategoryID"
rb.Question="Question"
rb.AnswerID="AnswerID"
rb.Answer="Answer"
rb.DataBind()
end sub

Sub submit(sender As Object, e As EventArgs)
end sub
</script><html>
<body>
<form runat="server">
Enter your name:
<asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form></body>
</html>

i am currently getting the following errors

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'rb' is not declared.

Source Error:



Line 4: dim myknowledgebase=New DataSet
Line 5: myknowledgebase.ReadXml(Server.MapPath("knowledgebase.xml"))
Line 6: rb.DataSource=myknowledgebase
Line 7: rb.QuestionID="QuestionID"
Line 8: rb.CategoryID="CategoryID"


Source File: C:\Documents and Settings\paul\My Documents\website\index.aspx Line: 6

Basically i am hoping someone can tell me how to contect properly.

also i am not sure if to load the xml parts in first as the user needs to hit submit button before it searches so do i leave it until that happens or some how cache the data and then use it once they have searched.

your opinions would be great as well as any coding help links and books on the subject

thanks again"rb.DataSource=myknowledgebase" is the first time rb is mentioned

you never actualy declate what rb is.could you help me there please what should i declare it as as the tutorials i have looked at dont show it as having to be declared.

following following tutorial (with my slight adjustments)
<!-- m --><a class="postlink" href="http://www.w3schools.com/aspnet/aspnet_xml.aspi">http://www.w3schools.com/aspnet/aspnet_xml.aspi</a><!-- m --> have sorted it.

new quesrtion though how do i put variables created in one sub routine into another (second sub routine is called inside the first subroutine)

i ave a list of words which can be to any size and need to copare them to the ones i the second sub routine)
 
Back
Top