Chtěl bych se zeptat,kde je problém. Používám při výběru dat příkaz LIKE. V syntaxi jsou použity i znaky %,zastupující libovolné znaky. Jak je možné,že když textbox nechám prázdný,tak se zobrazí prázdná stránka? Mělo by se přeci zobrazit vše,pokud se nepletu. Mrkněte na zdroják prosím,pomozte.
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="processcd,partno,resultsym"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="processcd" HeaderText="processcd" ReadOnly="True" SortExpression="processcd" />
<asp:BoundField DataField="partno" HeaderText="partno" ReadOnly="True" SortExpression="partno" />
<asp:BoundField DataField="resultsym" HeaderText="resultsym" ReadOnly="True" SortExpression="resultsym" />
<asp:BoundField DataField="sum1st" HeaderText="sum1st" SortExpression="sum1st" />
<asp:BoundField DataField="sum2nd" HeaderText="sum2nd" SortExpression="sum2nd" />
<asp:BoundField DataField="sum3rd" HeaderText="sum3rd" SortExpression="sum3rd" />
<asp:BoundField DataField="sum4th" HeaderText="sum4th" SortExpression="sum4th" />
<asp:BoundField DataField="sum5th" HeaderText="sum5th" SortExpression="sum5th" />
<asp:BoundField DataField="sum6th" HeaderText="sum6th" SortExpression="sum6th" />
<asp:BoundField DataField="sum7th" HeaderText="sum7th" SortExpression="sum7th" />
<asp:BoundField DataField="sum8th" HeaderText="sum8th" SortExpression="sum8th" />
<asp:BoundField DataField="sum9th" HeaderText="sum9th" SortExpression="sum9th" />
<asp:BoundField DataField="sum10th" HeaderText="sum10th" SortExpression="sum10th" />
<asp:BoundField DataField="sum11th" HeaderText="sum11th" SortExpression="sum11th" />
<asp:BoundField DataField="sum12th" HeaderText="sum12th" SortExpression="sum12th" />
<asp:BoundField DataField="sum13th" HeaderText="sum13th" SortExpression="sum13th" />
<asp:BoundField DataField="sum14th" HeaderText="sum14th" SortExpression="sum14th" />
<asp:BoundField DataField="sum15th" HeaderText="sum15th" SortExpression="sum15th" />
<asp:BoundField DataField="sum16th" HeaderText="sum16th" SortExpression="sum16th" />
<asp:BoundField DataField="sum17th" HeaderText="sum17th" SortExpression="sum17th" />
<asp:BoundField DataField="sum18th" HeaderText="sum18th" SortExpression="sum18th" />
<asp:BoundField DataField="sum19th" HeaderText="sum19th" SortExpression="sum19th" />
<asp:BoundField DataField="sum20th" HeaderText="sum20th" SortExpression="sum20th" />
<asp:BoundField DataField="sum21th" HeaderText="sum21th" SortExpression="sum21th" />
<asp:BoundField DataField="sum22th" HeaderText="sum22th" SortExpression="sum22th" />
<asp:BoundField DataField="sum23th" HeaderText="sum23th" SortExpression="sum23th" />
<asp:BoundField DataField="sum24th" HeaderText="sum24th" SortExpression="sum24th" />
<asp:BoundField DataField="sum25th" HeaderText="sum25th" SortExpression="sum25th" />
<asp:BoundField DataField="sum26th" HeaderText="sum26th" SortExpression="sum26th" />
<asp:BoundField DataField="sum27th" HeaderText="sum27th" SortExpression="sum27th" />
<asp:BoundField DataField="sum28th" HeaderText="sum28th" SortExpression="sum28th" />
<asp:BoundField DataField="sum29th" HeaderText="sum29th" SortExpression="sum29th" />
<asp:BoundField DataField="sum30th" HeaderText="sum30th" SortExpression="sum30th" />
<asp:BoundField DataField="sum31th" HeaderText="sum31th" SortExpression="sum31th" />
<asp:BoundField DataField="timestamp" HeaderText="timestamp" SortExpression="timestamp" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CIGMAConnectionString %>"
SelectCommand="SELECT * FROM [HSprin] WHERE ([partno] LIKE '%' + @partno + '%')">
<SelectParameters>
<asp:ControlParameter ControlID="TextBox1" Name="partno" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
|