Hi -
I have a few problems....1st creating a search box - this is what i have so far:
<HTML>
<HEAD>
<script language="
vb" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim MyConnection As SqlConnection = New SqlConnection("server=(local);database=XXX;Trusted _Connection=yes")
Dim MyCommand As SqlCommand = New SqlCommand("select location from location where location like'%' & TextBox1.Text & '%'", MyConnection)
MyConnection.Open()
Dim dr As SqlDataReader = MyCommand.ExecuteReader()
End Sub
</script>
</HEAD>
<body>
<form runat="server">
<asp:Label id="Label1" runat="server" Font-Names="Verdana" Font-Size="X-Small" Font-Bold="True"
style="Z-INDEX: 100; LEFT: 16px; POSITION: absolute; TOP: 24px">Search Location</asp:Label>
<asp:TextBox id="TextBox1" runat="server" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 48px"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="Search" style="Z-INDEX: 102; LEFT: 184px; POSITION: absolute; TOP: 48px"></asp:Button>
</form>
</body>
</HTML>
The error messages state that the column prefix 'TextBox1' does not match with a table name or alilas name use in the query. From this i am guessing that i have referenced TextBox1 in the wrong place. Can someone guide me in the right direction here please??
Once I have this search box set up, i need the results of the search to be in a listbox (when submit selected). Any suggestions on how to go about doing this??
I then need to be able to select the chosen result and submit it so that it is pasted (on the same page) in a textbox.
Any suggestions??
rizp