|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datagrid Control in VS2005for sqldatasource filter bound to a datagrid control I have created an asp .net web page. To the page I added datagrid control. The datagrid control getting it's data from sqldatasource. The sqldatasource is defined as a straight select against one table. I have, also, added textbox control to the same page. I have defined filter parameter for the sqldatasource as textbox1.text. The filter expression is yow_model_no like '%{0}%' . This works. If I try to add another text box and define another filter parameter. In the filter expression I specify yow_model_no like '%{0}%' and upc_code like '%{1}%'. This doesn't work. Could someone tell me where I went wrong here? Thanks in advance Works for me.
Selects all rows within Northwind.Customer table such that CustomerID and ContactName columns contains at least an 'i' in it. <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" FilterExpression="CustomerID LIKE '%{0}%' AND ContactName LIKE '%{1}%'" SelectCommand="SELECT * FROM [Customers]"> <FilterParameters> <asp:Parameter DefaultValue="i" Name="p1" /> <asp:Parameter DefaultValue="i" Name="p2" /> </FilterParameters> </asp:SqlDataSource> rgelfa***@hotmail.com wrote: Show quoteHide quote > My goal is to apply data entered in multiple text boxes as parameters > for sqldatasource filter bound to a datagrid control > > I have created an asp .net web page. To the page I added datagrid > control. The datagrid control getting it's data from sqldatasource. > The sqldatasource is defined as a straight select against one table. > > > I have, also, added textbox control to the same page. I have defined > filter parameter for the sqldatasource as textbox1.text. The filter > expression is yow_model_no like '%{0}%' . > This works. > > > If I try to add another text box and define another filter parameter. > In the filter expression I specify yow_model_no like '%{0}%' and > upc_code like '%{1}%'. > This doesn't work. > > > Could someone tell me where I went wrong here? > > > Thanks in advance
dropdown list post back not working
Treeview SelectedNodeStyle Problem ObjectDataSource ControlParameters Passing values to user controls - naughty problem Why it doesn't work? Problem with ASP.NET wizard hiding / removing steps problem with hidden field from a custom control in a form Can't access webpage's controls from the code-behind file after putting it in a <asp:LoginView/> Interrogating cells on current row for GridView Problem with spaces in values of the DataTextField property of datagrid control |
|||||||||||||||||||||||