本文介绍了我想从gridview中获取多个选择的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在多个关键字搜索的基础上搜索值。我使用sqldatasource和gridview控件。当我从一个文本中搜索值时,它正常工作但是当我使用两个文本bxes获得更多预期的结果时它不工作



从1个文本框中搜索我正在使用 -

< asp:SqlDataSource ID =SqlDataSource1runat = serverConnectionString =<%$ ConnectionStrings:RagistrationConnectionString%> SelectCommand =SELECT [FirstName],[LastName],[State],[City],[SkillArea],[Skill],[WorkAuthorizationStatus],[ExpectedSalary] FROM [Resumeview] WHERE Skill Like'%'+ @ Skill +'% '>

< SelectParameters>

< asp:ControlParameter ControlID =TextBoxSName =SkillPropertyName =TextType =StringDefaultValue =%/>

< / SelectParameters>





哪个工作正常但是什么时候我正在从2个文本框中进行搜索,我正在使用 -



< asp:SqlDataSource ID =SqlDataSource1runat =serverConnectionString =< %$ ConnectionStrings:RagistrationConnectionString%> SelectCommand =SELECT [FirstName],[LastName],[State],[City],[SkillArea],[Skill],[WorkAuthorizationStatus],[ExpectedSalary] FROM [Resumeview] WHERE Skill Like'%'+ @ Skill +'% '>

< SelectParameters>

< asp:ControlParameter ControlID =TextBoxSName =SkillPropertyName =TextType =StringDefaultValue =%/>

< asp:ControlParameter ControlID =TextBoxSAName =SkillAreaPropertyName =TextType =StringDefaultValue =%/>

< / SelectParameters>





无效

I want to search values on bases of multiple keyword search.I used sqldatasource and gridview control.When I'm searching value from one text bo its working properly but when I'm using two text bxes to get more expected reasult than its not working

For searching from 1 text box i'm using-
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RagistrationConnectionString %>" SelectCommand="SELECT [FirstName], [LastName], [State], [City], [SkillArea], [Skill], [WorkAuthorizationStatus], [ExpectedSalary] FROM [Resumeview] WHERE Skill Like '%' +@Skill+ '%' ">
<SelectParameters>
<asp:ControlParameter ControlID="TextBoxS" Name="Skill" PropertyName="Text" Type="String" DefaultValue="%"/>
</SelectParameters>


Which is working fine but when i'm searcching from 2 text boxes and I'm using-

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RagistrationConnectionString %>" SelectCommand="SELECT [FirstName], [LastName], [State], [City], [SkillArea], [Skill], [WorkAuthorizationStatus], [ExpectedSalary] FROM [Resumeview] WHERE Skill Like '%' +@Skill+ '%' ">
<SelectParameters>
<asp:ControlParameter ControlID="TextBoxS" Name="Skill" PropertyName="Text" Type="String" DefaultValue="%"/>
<asp:ControlParameter ControlID="TextBoxSA" Name="SkillArea" PropertyName="Text" Type="String" DefaultValue="%"/>
</SelectParameters>


its not working

推荐答案




这篇关于我想从gridview中获取多个选择的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 08:49