Forms Data Controls :: Search Parameters Mismatched Message

Mar 29, 2010

I have three parameters to search data and populate to gridview. The parameters are textboxes and dropdowns. These are independent.

If the parameters are not matching and not fectching data from table then the gridview count is 0 therefore I am displaying a message to the user that the "data is not available".

The message I displayed to the user using the EmptyTemplate of Gridview.

I want some enhancement that if the parameters are not matched and there is not data fetch from the table then message should be more specifice like:

txtRegion and lstSection are mismatched.

or

txtRegion and txtLocation are mismatched.

View 7 Replies


Similar Messages:

DataSource Controls :: Filter Parameters/Search Form

Oct 10, 2010

I've got a gridview that I need to perform filters on. All works great until I try and add a date range..

Below is the code. Basically I have 5 dropdown lists which all filter as expected giving them the option to use each one or just the ones they need.

The problem is they want to also have the option of filtering by date i.e date range or greater than or less than or equal to etc..

As soon as I add the date parameter it stops the other filters working. I'm guessing because I have a null value in the date field (textbox) if they dont use the option??

Does anyone have a sample on how to filter by dropdown lists and dates keeping in mind they wont use all the filter options?

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
.style2
{
width: 100%;
}
.style3
{
width: 137px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</br>
<table>
<tr>
<td>
Person Responsible</td>
<td>
<asp:DropDownList ID="DDLPersonResponsible" runat="server"
DataSourceID="SqlDataSource2" DataTextField="AssignedTo"
DataValueField="AssignedTo" AppendDataBoundItems="True"
AutoPostBack="True" Height="22px" Width="200px">
<asp:ListItem Text="All" Value="%"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Location</td>
<td>
<asp:DropDownList ID="DDlLocation" runat="server" Height="22px" Width="200px"
DataSourceID="SqlDataSource3" DataTextField="location"
DataValueField="location" AppendDataBoundItems="True"
AutoPostBack="True">
<asp:ListItem Text="All" Value="%"></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
SelectCommand="usp_Locations" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
Activity/Product/Service</td>
<td>
<asp:DropDownList ID="DDlActivity" runat="server" DataSourceID="SqlDataSource4"
DataTextField="Activity" AppendDataBoundItems="True"
AutoPostBack="True" Height="22px" Width="200px">
<asp:ListItem Text="All" Value="%"></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
SelectCommand="usp_Activity" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
Risk Ranking</td>
<td>
<asp:DropDownList ID="DDlRiskRanking" runat="server" AppendDataBoundItems="True"
AutoPostBack="True" >
<asp:ListItem Value="%">All</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Reference</td>
<td>
<asp:DropDownList ID="DDLReference" runat="server" DataSourceID="SqlDataSource5"
DataTextField="Reference" AppendDataBoundItems="True"
AutoPostBack="True" Height="22px" Width="200px">
<asp:ListItem Text="All" Value="%"></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
SelectCommand="usp_SelectReference" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
Target Date</td>
<td style="margin-left: 40px">Greater than
<asp:TextBox ID="txtstartTargetDate" runat="server" AutoPostBack="True"></asp:TextBox> Less Than
<asp:TextBox ID="txtendTargetDate" runat="server" AutoPostBack="True"></asp:TextBox>
</td>
</tr>
</table>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
SelectCommand="usp_AssignOwner" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
<br />
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="IssueId"
DataSourceID="SqlDataSource1" Width="803px" CellPadding="4"
ForeColor="#333333"
EmptyDataText="There are no matching records to display.">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="IssueId" HeaderText="IssueId" InsertVisible="False"
ReadOnly="True" SortExpression="IssueId" />
<asp:BoundField DataField="BriefDescription" HeaderText="BriefDescription"
SortExpression="BriefDescription" />
<asp:BoundField DataField="DateEntered" HeaderText="DateEntered"
SortExpression="DateEntered" />
<asp:BoundField DataField="EnteredBy" HeaderText="EnteredBy"
SortExpression="EnteredBy" />
<asp:BoundField DataField="Likelihood" HeaderText="Likelihood"
SortExpression="Likelihood" />
<asp:BoundField DataField="Consequence" HeaderText="Consequence"
SortExpression="Consequence" />
<asp:BoundField DataField="Location" HeaderText="Location"
SortExpression="Location" />
<asp:BoundField DataField="Activity" HeaderText="ActivityProductService"
SortExpression="Activity" />
<asp:BoundField DataField="Scope" HeaderText="Scope"
SortExpression="Scope" />
<asp:BoundField DataField="Aspect"
HeaderText="Aspect" SortExpression="Aspect" />
<asp:BoundField DataField="AspectRevised" HeaderText="AspectRevised"
SortExpression="AspectRevised" />
<asp:BoundField DataField="Impact" HeaderText="Impact"
SortExpression="Impact" />
<asp:BoundField DataField="Objective" HeaderText="Objective"
SortExpression="Objective" />
<asp:BoundField DataField="KeyAction" HeaderText="KeyAction"
SortExpression="KeyAction" />
<asp:BoundField DataField="TargetDate" HeaderText="TargetDate"
SortExpression="TargetDate" />
<asp:BoundField DataField="PersonResponsible" HeaderText="PersonResponsible"
SortExpression="PersonResponsible" />
<asp:BoundField DataField="PercentageCompleted"
HeaderText="PercentageCompleted" SortExpression="PercentageCompleted" />
<asp:BoundField DataField="Reference" HeaderText="Reference"
SortExpression="Reference" />
<asp:BoundField DataField="Comments" HeaderText="Comments"
SortExpression="Comments" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="AssignedTo" HeaderText="AssignedTo"
SortExpression="AssignedTo" />
<asp:BoundField DataField="RiskRanking" HeaderText="Risk Ranking" />
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
SelectCommand="usp_AllIssues" SelectCommandType="StoredProcedure" FilterExpression="assignedto like '{0}' and location like '{1}' and activity like '{2}' and riskranking like '{3}' and reference like '{4}' and targetdate > '{5}'">
<FilterParameters>
<asp:ControlParameter Name="assignedto" ControlID="ddlpersonresponsible"
PropertyName="SelectedValue" />
<asp:ControlParameter Name="location" ControlID="ddllocation"
PropertyName="SelectedValue" />
<asp:ControlParameter Name="activity" ControlID="ddlactivity"
PropertyName="SelectedValue" />
<asp:ControlParameter Name="riskranking" ControlID="ddlriskranking"
PropertyName="SelectedValue" />
<asp:ControlParameter Name="Reference" ControlID="ddlreference"
PropertyName="SelectedValue" />
<asp:ControlParameter Name="startdate" ControlID="txtStartTargetDate"
PropertyName="text" />
</FilterParameters>
</asp:SqlDataSource>
</asp:Content>

View 2 Replies

Crystal Reports :: Search Data With Parameters And Populate To CrystalView

Nov 3, 2010

I want to give option to user with two or three search parameters in textbox or dropdownand the result should display in CrystalViewer.

I know how to do this task with gridview but don't know how to do the same with CrystalViewer.

Moreover, can I have a weblink to download Video lecture on CrystalViewer?

View 2 Replies

DataSource Controls :: Full Text Search Test - Works Without Parameters

May 28, 2010

I'm new with all stored procs - but I have a very basic Full Text Search going on...I created a stored proc, and linked it up to my application using Linq to SQL. If I use Linq to SQL to call the stored proc without any parameters (hard coded search string) i get results back, as soon as I add a parameter - the result set is 0 for some reason.

The funny thing is that I run Profiler and execute both queries its trying to do - and it looks identical

Here is the working parameterless query:

[Code]....

and according to Profile this is what it looks like when its called as a stored proc

[Code]....

I get 2 results as expected.
Here is the NON-working stored proc that takes in 1 string parameter

[Code]....

and here is the query that gets called when profiling

[Code]....

declare @p4 int

View 3 Replies

Forms Data Controls :: How To Add Search Control For Detailsview For Search Page

Apr 19, 2010

how to Add Search Control for Detailsview for search page... simple solution required.?

and is it possible to give field names to each page numbering?

View 3 Replies

Forms Data Controls :: Search Using A Full Text Search Catalog?

Nov 26, 2010

how to do a search using a Full Text Search Catalog. I would also like to have the results on the page highlighted?

View 1 Replies

How To Search With Parameters In MVC

Jun 13, 2010

I need to be able to provide a page for the end user where thay can search in the following :

Search work
Category
Price
AdType
Location

and so on.

Its important that the user can copy the url and then use it later(and get the same settings). Its also important to be able to save these settings on the user in the database.

So far I have created a ModelView class that contains the parameters but I am not sure that this is the right way to go? Maby I should pass all inte the URL.

View 2 Replies

Code Behind And Page Results Are Mismatched

Mar 18, 2011

I am developing a website using VS2010. I have started receiving an issue today which is text boxes on my pages are not populated every time while code behind shows the text is changed.

I have a text box to input an ID and on validation the record is fetched and details are shown in other text boxes. There are certain IDs on which the code behind (while debugging) shows the Text property of all text boxes are changed to reflect the fetched record but after completion of the event, text boxes are shown with previous texts, their texts are not those which were shown in the code behind.

I tried both VS2010 and VS2008. I have dual core machine. "Set Affinity" didn't work.

View 1 Replies

MVC :: Page With Search Parameters?

Jun 15, 2010

I have a strong typed view bound to the following type :

[Code]....

As you can see it is containing both the data and the search parameters(dont know if this is a good idea?). The method looks like this :

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult List(AdList adList)
{
try
{
return View(adList);
}
catch (Exception ex)
{
throw ex;
}
}

What I need is to provide a search page where the user can set parameters and see a list of data(depending on parameters. It should be using QueryString to be able to get to a specific setup with the URL. I supose that I could set the "<form method=get.." this would generate a QueryString on submit but Im not sure that this would work in the current setup? Maby I have to place the seartch stuf in a partialView?

View 6 Replies

Data Controls :: Search In GridView Using JQuery Quick Search Inside AJAX TabContainer

Dec 2, 2013

I made a usercontrol consisting of an AJAX tab control, a textbox, and a gridview.  The gridview is pulling data from a SQL database.  When the gridview is outside of the tab control and I begin to enter text into the textbox, quicksearch begins to filter the information in the gridview.  When i put the gridview and textbox inside an AJAX tab control quicksearch does not work.  How do i need to structure the textbox and the gridview on an ajax update panel to get it to work?

View 1 Replies

MVC :: How And Where To Store Search Parameters In Application

Oct 14, 2010

I am working on a railway web application and I have following layers:

[Code]....

I pass Domain Entity Objects from Repository to Service layer and thinking of passing View Models from Service to Presentation layer. Website would require a login and after successful login I have to present a search screen with basic search (as default option) and option for advance search. Once user fills the
search criteria I have to gather data from DB & Web Services and present the results to user. User would select a particular Rail option and would move on to other additional options page BUT they should be allowed to change their previously selected Rail option by going back to Rail search results. I have to
always hold and present user's initial search criteria (basic and advance search options selected by user on the search wizard) on every screen and need these criteria in Service and Repository layers.

What is the best way to hold these search criteria and pass them from page to page within presentation layer and across layers? Should I create a View Model class for Search Options? Or a Domain Entity Object (I don't think so)? and best way to pass it across layers and from page to page with in presentation layer.

View 1 Replies

MVC Routing - Multiple (Optional) Search Parameters

Nov 26, 2010

I'm trying to implement a search function on an incident logging page that is working fine. Currently I am only able to search against one criteria at a time, using the following route:

View 2 Replies

SQL Reporting :: Using Parameters To Search Dates In Services

Sep 19, 2010

I have recently started using SQL Server Reporting services. I currently have a problem. I am trying to achieve a search by dates in a report. I have a table with the fields RequestDate in e.g. 22-Jan-2010 or 23-Sep-2010. I have created a report in Query Designer with two parameters in it RequestDate & RequestDate2.

The Operators are for RequestDate is: Is more than or equal to The value is: 1-Jan-2010 And the Operator for RequestDate2 is: Is less than or equal to. The value is 30-Dec-2010 When i go to the SQL Statement this is produced:

SELECT
MHRA.ImportRequestID
,MHRA.UniqueID
,MHRA.CreatedBy
,MHRA.RequestDate
FROM
MHRA
WHERE
MHRA.RequestDate >= @RequestDate
AND MHRA.RequestDate <= @RequestDate2

When i go to view report i want to be able to search for dates between the dates 1 Jan 2010 and 30-Aug-2010 My query seems to pick up all or most of the results between these dates. How can i build this query so i can get specific results. For example...in the Request Date Parameter box i would put 2-feb-2010 and in Request Date 2 i would put in 5-Jun-2010 and this would return all the results between these dates.

View 1 Replies

SQL Reporting :: RDLC Report: Mismatched Number Of Pages In View And Print?

Apr 6, 2010

I have a problem while printing rdlc report (local). The number of pages of the report in viewer is fewer than that in the print. This leads to a problem while printing the report from - to a particular page. For eg: The report viewer shows 9 pages while viewing but when I go for print it prints 14 pages. The data is not lost but records from page 1 are transfered to page 2 while printing.

View 6 Replies

Display A Message If The Search Returned No Results?

May 21, 2010

I have this code:

Dim Result As New DataTable
DataAdapter.Fill(Result)
'bind data to visible surname/name grid
If Result.Rows.Count = 0 Then
NoInputBottom.Text = "No Results. Please widen your search criteria and try again"
NoInputTop.Text = "No Results. Please widen your search criteria and try again"
Else
GV.DataSource = Result
GV.DataBind()
End If

I have also tried moving the check to the gridview like so:

If GV.Columns.Count = 0 Then
NoInputBottom.Text = "No Options Selected: Please select your search criteria and try again" NoInputTop.Text = "No Options Selected: Please select your search criteria and try again" End If

When I run the code. the noinput labels do not have value, the null check seems to be failing? how to display a message if the search returned no reults.

View 1 Replies

Web Forms :: If The User Doesnot Select Any Of The Above Three Then A Message Gets Displayed As "Please Select One Search Criteria?

Mar 2, 2011

Can any one let me know about the below issue. I have a page which has three labels, say startdate,enddate and username. My issue is if the user doesnot select any of the above three then a message gets displayed as "Please select one search criteria" or if the user doesnot enter the date in correct format then i dispaly "Please enter date in mm/dd/yy" format. But what is happening is first time if the user doesnot select any then "Please select one search criteria" is getting displayed and after this message gets displayed if the user enters wrong format of date then both the messages are displayed.

View 5 Replies

Forms Data Controls :: Set Parameters From GridView_RowUpdating?

Feb 20, 2010

How can I set update parameters from GridView's Row_Updating()?

View 3 Replies

Forms Data Controls :: Syntax For Passing ListView Data To SQL Input Parameters?

Dec 11, 2010

I have a ListView displaying data from Table A using a SqlDataSource.

I want to take the displayed data (and these are just the standard columns representing fields in Table A) and store them in Table B using a Stored Procedure

(The scenario is much more complex but I've left out anything not relating to this exact problem).

I've added a Button to the ListViews ItemTemplate and I'm using OnItemCommand to create a Sub for its "Click" in the Code Behind.

This is a simplified chunk of the SQL I'm using to insert the ListView's fields into Table B using the Stored Procedure "InsertCart":

[Code]....

Where I've highlighted "Description" in the last line. In a GridView, this would be enough. Description is a Column name in Table A and B and iy's an Item in the ListView. But I'm realising that, with ListView's, the data binding is not as "automatic" as a GridView. Just using the columnname is not enough.

What do I use instead of the word Description to reference this column in the Parameter?

View 2 Replies

Forms Data Controls :: Gridview Not Passing Parameters To SQL Data Source?

Feb 13, 2011

I have a gridview and I have an edit template for one control. I have a drop down box in this edit template so that you can select a value from it and then when you hit 'Update' the value from the drop down box is committed to the updated record. Unfortunately when I do hit the update button I get a fault that the "Status" field cannot be null.

Here is the code that picks the value from the drop down value and assigns it to the new values list:

[Code]....

View 4 Replies

Forms Data Controls :: SqlDataSource Pass Parameters

Mar 15, 2011

I have big filter coming from database by using storedprocedure. This stored procedure contains about 12 parameters. In asp.net page I select these values and after doing that I want to pass these values to SqlDataSourec which is bound to gridview. How can I pass these values to SqlDataSource, manually in codebehind?

View 8 Replies

Forms Data Controls :: How To Add 2 Parameters To One Field Using SqlDataSource

Sep 2, 2010

I am working on a form that I would like to display a dropdownlist or textbox to insert data into the same field.

Currently it is setup where the end user can use one or the other but not both. I am running into a problem getting with the insert parameters for the secondary control. In this case the textbox.

Is it possible to use and Or statment in my Insert Query? I have tried to no avail.

[Code]....

View 3 Replies

Forms Data Controls :: How Specify Input Parameters To UpdateCommand

Oct 9, 2010

How specify input parameters to UpdateCommand

View 3 Replies

Forms Data Controls :: Two Filter Parameters In One FilteExpression?

May 16, 2010

I can't seem to use thFilterExpression to filter using more then one parameter

I've tried this with no success:

FilterExpression="ProductName LIKE '{0}%' OR ComputerName LIKE '{1}%'"

with just the one parameter it works fine.

View 6 Replies

Forms Data Controls :: ObjectDataSource's Select Parameters?

Feb 28, 2010

I have a DetailsView control with a SelectMethod and two select parameters wich one of the parameters is a control parameter, The parameters are not passed to objectDatasource's select method, the objectdatasource has been defined as follows:

<asp:ObjectDataSource ID="objCurrCompetitor" runat="server" SelectMethod="GetCompetitorByUserAndCompetition"
DeleteMethod="DeleteCompetitor"
TypeName="MZ.Competitions.BLL.Main.Competitor"

[code]...

View 2 Replies

Forms Data Controls :: Search Data In Textbox In Header Text In Gridview?

Apr 2, 2010

I have the grid view with boundfield with four columns. I created the text box when gridview row created event. I need to filter the data the gridview using the textbox and need to know the how to generate event for textbox.

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved