asp.net & SQL

Baz

Baz

Soldato
Joined
9 Dec 2002
Posts
4,375
Location
Peterborough
I am using Microsoft's free Visual web developer express to play about with asp.net (having already written the intranet in good old asp...) and especially the dataview and data list controls. In particular I have a table that I wish to pull data from when you enter it into a text box (i also have a stored procedure that does similar but uses wildcards)
I have placed a text box and submit button on the page, and a gridview, but I cannot seem to be able to link the two together to get the results...
 
DOuble clicking on the submit button works ok....

no idea where to put the datareader bits..

heres the asp code for you :-s

Code:
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

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

	End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
	<title>Untitled Page</title>
<script language="javascript" type="text/javascript" id="txtpo">
<!--



function Text1_onclick() {

}

function Submit1_onclick() {

}

// -->
</script>
</head>
<body>
	<form id="form1" runat="server">
	<div>
		<input id="txtpo" type="text" language="javascript" onclick="return Text1_onclick()" />
		<input id="Submit1" type="submit" value="submit" language="javascript" onclick="return Submit1_onclick()" />
		&nbsp;
		<br />
		<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="pk"
			DataSourceID="SqlDataSource1" Height="50px" Width="125px">
			<Fields>
				<asp:BoundField DataField="A_PO" HeaderText="A_PO" SortExpression="A_PO" />
				<asp:BoundField DataField="a_store" HeaderText="a_store" SortExpression="a_store" />
				<asp:BoundField DataField="A_Haulier" HeaderText="A_Haulier" SortExpression="A_Haulier" />
				<asp:BoundField DataField="A_EDD" HeaderText="A_EDD" SortExpression="A_EDD" />
				<asp:BoundField DataField="a_esad" HeaderText="a_esad" SortExpression="a_esad" />
				<asp:BoundField DataField="a_esat" HeaderText="a_esat" ReadOnly="True" SortExpression="a_esat" />
				<asp:BoundField DataField="a_pexp" HeaderText="a_pexp" SortExpression="a_pexp" />
				<asp:BoundField DataField="a_asa" HeaderText="a_asa" SortExpression="a_asa" />
				<asp:BoundField DataField="a_seal" HeaderText="a_seal" SortExpression="a_seal" />
				<asp:BoundField DataField="a_tempu" HeaderText="a_tempu" SortExpression="a_tempu" />
				<asp:BoundField DataField="a_insp" HeaderText="a_insp" SortExpression="a_insp" />
				<asp:BoundField DataField="a_prec" HeaderText="a_prec" SortExpression="a_prec" />
				<asp:BoundField DataField="v_mot" HeaderText="v_mot" SortExpression="v_mot" />
				<asp:BoundField DataField="v_vesvoy" HeaderText="v_vesvoy" SortExpression="v_vesvoy" />
				<asp:BoundField DataField="v_cont" HeaderText="v_cont" SortExpression="v_cont" />
				<asp:BoundField DataField="v_peach" HeaderText="v_peach" SortExpression="v_peach" />
				<asp:BoundField DataField="v_supplier" HeaderText="v_supplier" SortExpression="v_supplier" />
				<asp:BoundField DataField="v_description" HeaderText="v_description" SortExpression="v_description" />
				<asp:BoundField DataField="insertdate" HeaderText="insertdate" SortExpression="insertdate" />
				<asp:BoundField DataField="pk" HeaderText="pk" InsertVisible="False" ReadOnly="True"
					SortExpression="pk" />
			</Fields>
		</asp:DetailsView>
		<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:icddevConnectionString2 %>"
			SelectCommand="stpwildcard" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:FormParameter FormField="form1" Name="a_PO" Type="String" />
			</SelectParameters>
		</asp:SqlDataSource>
	</div>
	</form>
</body>
</html>
 
Back
Top Bottom