.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

How to filter SQL data

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net
 

Hello,

Could someone please point me to a simple way to filter SQL data when it is retrieved by a GridView control?

Among the various applications I need to create are selecting records based on user inputed criteria (via a DropDownList), and excluding records that have null values (which I need to allow in my database) in certain columns.

Thank you.

 

 




View Complete Post


More Related Resource Links

How to filter managed meta data column using page query string?

  
I have two managed term sets as follows: Articles:Downloads Projects:Downloads I am trying to use a content query web part to filter a list based on the above manged meta data column. I want to filter out only "Articles:Downloads" Scenario 1: When I edit the web part and directly set the filter option with the managed meta data column to "Articles:Downloads" it works fine. When I export the web part, in the .webpart file, the "FilterValue1" property has a value "Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910". Scenario 2: I want the web part to get the filter information from query string [PageQueryString:pageType]. So I tried using these options: a) pageType=Downloads      This works but returns downloads under 'projects' as well. (i want downloads only under 'articles')  b) pageType=Articles:Downloads     Does not work and shows no records c) pageType = Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work. (This value is the same as one found in 'FilterValue1' of the static web part). c) pageType = Articles:Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work. d) pageType = 9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work.   What am I missing here? Can some one please help?

Filter out logically deleted data from dbf file using SSIS?

  
Hi Guys, while loading dbf file to sql server using SSIS,How can i filter out the records that are logically deleted in dbf file?    ~Technology Analyst~

Filter External List by a range of data

  
I have an external list web part that I am currently using a choice filter on to filter by a certain status.  The options are yes, no, or (empty).  However, I would like to be able to add an additional option to filter where the person has the previous status set to no, but has a value in a different field greater than 90. I realize that the choice filter probably wouldn't do this, and that I could do this easily with separate list views, where I have some sort of web part that can change the list views on the fly. I would think I could use one of those list filters to do this, but when I tried to do that for my original problem, I was unable to connect the filter to my external list. I could connect the list view filter to any internal list without an issue however.  Somebody commented on my old thread that I posted as cptInsane0 that I could just make an infopath view form that has buttons that do this.  I have dabbled with infopath a little bit, but I wasn't able to get infopath to connect to my external list either.  I first had to connect to an internal one, and then for some reason I could add the external list as an alternate data source. I can't be the first person who has had this issue. Could someone point me in the right direction?

Data View that handles both a Filter and "Show All"

  

I had a nice search facility up and running that filtered SQL data displayed in a Data View via a "contains" Filter clause on an entered string.

Pesky users now request a "Show All" button as well to display all data in the Data View.  For the life of me I cannot get this up and running - anybody got a tip/pointer?  I can't figure a combination of Filter criteria that would allow this.

thanks

Ritchie

 


Full text search not working for pre-existing data on table after installing docx filter.However wor

  

Hello All,

 

I have a strange issue. I have pre-existing data in my table with full text index defined along with catalog. I noticed that I did not have the docx filter ,so I installed the filter and performed the steps below. After installing the filter  I added a couple of new records. I noticed that the full text search pulled up the new records matching the criteria but did not return any pre-existing records. Could you please let me know the issue.Please note – currently I am using sql 2008 , but also would like to verify the same in sql 2005 as well.

Also could you please verify the steps below for installation in sql 2008 and sql 2005 and with different architectures (Eg windows 2003/2008, 32bit, 64 bit etc)

 

This was tested on VM image on 64 bit architecture Windows 200

Is there a way to query entity based on multiple filter criteria? WCF Data Services, Linq to Entiti

  

Instead of:

DW_CMSOPEN dwc = new DW_CMSOPEN(new Uri("http://acctdev02/WCFDataService/EmployeeService.svc"));

dwc.Credentials = System.Net.CredentialCache.DefaultCredentials;

var employees = from emp in dwc.Employees 
             where emp.DEPT == "123"
             select emp;

I'd like the linq query to resemble:

var employees = from emp in dwc.Employees
              where emp.DEPT // in {"123", "456", etc}
              select emp;

How to filter out null data

  

(SSAS/SQL 2005)

I am running a query against two different measure groups.  I'm using Non Empty.  Can I use something in the WHERE clause to block results where one of the measures is null?

In the following query I'd like to return only rows with non null Prc Net Weight:

WITH

 

 

 

MEMBER [Measures].[Weight Calc] AS [Measures].[Coil Weight] + [Measures].[Prc Net Weight]

Integrating PPS Multi level filter into SSRS which uses SQL to pull data

  

Hello,

I'm trying to integrate PPS filter (which is created using MDX query and its a multi select tree filter) with an SSRS report, for which the background is SQL Query. Can you please guide me to achieve this. I'm not sure how we can link the multi level hierarchy to an SQL query which is been used in the content part of the SSRS report. For example I have a geography hierarchy in a cube and I use an mdx query to create and populate PPS filter. I need to use this filter in an SSRS report for which the query is 'select col name(s) from table'. Also my hierarchy in the cube is not a natural hierarchy.

Any guidance would be really great and thank full.

- Arvind


Arvind

After adding filter, data fetch limit error

  

Alright, so i'm getting the "this page has exceeded its data fetch limit for connected web parts" error.
But it only happens if i add a filter.

Currently I have 6 lists on the page and am using 4 filters, so why can't I add a 5th filter?

Forgot to mention that I added the filters with SharePoint designer 2007


filter table data to report

  

hello,

I have a table which captures the updated data. I need to generate a report on updated fields.

Could you please tell me how to filter the updated data from the table to display in the report.

I'm new to this so i need the sql code or stored procedure to filter and show only the updated data.

 

Well I have time stamp as well as a column for last changed date.

 

i need to produce all the fields pertaining to the updated cell in a single cell of the report.

for instance i change the last name of the person - i need to produce the persons firsname , updated lastname, his address and other details in a single cell of a report.

 i also need to show the records in both ascending and decending way - like most recent update of the day and first update of the day.

so how do i code for this.

 

thank u for your help


Filter table data in sql

  

hello,

I have a table which captures the updated data. I need to generate a report on updated fields.

Could you please tell me how to filter the updated data from the table to display in the report.

I'm new to this so i need the sql code or stored procedure to filter and show only the updated data.

 update-----

 

Well I have time stamp as well as a column for last changed date.

 

i need to produce all the fields pertaining to the updated cell in a single cell of the report.

for instance i change the last name of the person - i need to produce the persons firsname , updated lastname, his address and other details in a single cell of a report.

 i also need to show the records in both ascending and decending way - like most recent update of the day and first update of the day.

so how do i code for this.

 

thank u for your help 

 

thanks

 

justin


filter the data from a table to a report

  

hello,

I have a table which captures the updated data. I need to generate a report on updated fields.

Could you please tell me how to filter the updated data from the table to display in the report.

I'm new to this so i need the sql code or stored procedure to filter and show only the updated data.

 

Well I have time stamp as well as a column for last changed date.

 

i need to produce all the fields pertaining to the updated cell in a single cell of the report.

for instance i change the last name of the person - i need to produce the persons firsname , updated lastname, his address and other details in a single cell of a report.

 i also need to show the records in both ascending and decending way - like most recent update of the day and first update of the day.

so how do i code for this.

 

thank u for your help


[SQL] can we filter data after group by?

  

with SaleSheet(SaleDate,SaleAmount,VipId) as
(
select '2010/02/01' as SaleDate ,10 as SaleAmount,'Allen' as VipId
union all
select '2010/02/01' as SaleDate ,20 as SaleAmount,'Allen' as VipId
union all
select '2010/02/01' as SaleDate ,20 as SaleAmount,'Joy' as VipId
union all
select '2010/02/02' as SaleDate ,10 as SaleAmount,'Allen' as VipId
union all
select '2010/02/03' as SaleDate ,20 as SaleAmount,'Allen' as VipId      -- Allen reach the thresold  on 2010/02/03
union all
select '2010/02/04' as SaleDate ,10 as SaleAmount,'Joy' as VipId
union all
select '2010/02/05' as SaleDate ,10 as SaleAmount,'Amy' as VipId
union all
select '2010/02/05' as SaleDate ,10 as SaleAmount,'Joy' as VipId
union all
select '2010/02/05' as SaleDate ,50 as SaleAmount,'Amy' as VipId        -- Amy reach the thresold  on 2010/02/05
union all
select '2010/02/06' as SaleDate ,10 as SaleAmount,'Joy' as VipId
union all
select '2010/02/06' as SaleDate ,10 as SaleAmount,'Amy' as VipId
union all
select '2010/02/06' as SaleDate ,10 as SaleAmount,'Joy' as VipId
)




-- I run Query on 2010/02/06 and want to know which member reach the thresold ( SaleAmount > 50 ) be

filter data in reapeating table

  

Hi all,

I created repeating table that retrieve data from share point list( Secondary data source),in this repeating table it display only one row(first selected row in list).I used conditional formatting to filter data.I need to display all the data in the repeating table where condition is true.Give me a solution for this.....

thanks......

 


How to filter data in repeating section using field value in repeating table?

  

Hi!

My form is web-browseable. I have a repeating table and repeating section in one of my form views. 

I want to filter data in my repeating section by field value in selected row in repeating table. How is it possible? How to fire event on row change in reapeating table? How to get value from field in selected row?

Actualy, it is the same data in these sections, but its a list with some fields in the reapeating table and all fields(details)  in reapiting section. I would like to filter data in repeating section by field DPNumber in repeating table.

 


Specifying a parameter in a matrix filter - the data type automatically changes to 'text' when it

  

 

When specifying a parameter in a matrix filter (Report Builder 2) the data type automatically reverts to 'text' when it should be 'date/time'.  Removing the parameter and re-adding it displays it correctly as 'date/time' but this isn't saved when clicking 'OK'. 

The problem only becomes apparent when the parameter is set to 'allow multiple values'.  Once this is selected the report throws up the following error:

"An error has occured during report processing. The processing of FilterExpression for the tablix 'Tablix1' cannot be performed.  Cannot compare data types System.String and System.Object[]. Please check the data type returned by the FilterExpression."

Is this a bug with Report Builder 2 or is there something wrong with my report model?

Any help/guidance greatly appreciated.


Filter Data View Web Part based on a field

  

Hello,

I am trying to filter a data view web part based on a choice made by the end user. I have a lookup field in the Pages list that displays the Title of all pages within that list. I want it so that when an end user selects something from that field that it will filter the list accordingly. Do I need to create a variable, parameter or something of that nature?

Any help is greatly appreciated! Thanks in advance.

S.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend