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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Filter datatable by passibg parameter containing wildcards

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
Hi I want to filter the DataTable. for filtering the the datatable I am  passing the string parameter which contains multiple wildcards ( e.g. string strSearchValue = "test%str%g")   Can anybody help how should I achive this? I am using VB.Net 2008 .

View Complete Post

More Related Resource Links

How to pass a parameter from a choice filter with project IDs to a KPI web part?



I have an excel pivot table like this:

Report Filter: Project ID
proj_name     Status 
A              70
B              60
C              80

I have this workbook published onto Sharepoint server through excel services.
On the site i have a choice filter that has all the project ID's. I am able to show this table in a web part and filter the web part by passing parameter from the choice filter to the report filter in the workbook as shown above.
I added a KPI webpart that uses the "status" from the above table as its indicator value. What I want to do is that I want to pass the parameter from the choice filter on the site to this KPI web part so that it will show me the corresponding status dynamically accoring to the project chosen.
Can someone help me solve this problem?

Parameter or Filter?

Hello together. I am straight at a Expense report tool and need a parameter for the date. I have already a Paramtere for customers. My question is how I can issue data "of - until"? e.g. 11.09.2002 - 11.09.2010 Already much tried, however if I spend the date, the wrong customer is indicated. but I want only these customers, who have a Expense in this period. Sorry for English. I started just three months ago. Reagards Patrick

BDC need explanation about parameter, filter and OOB WP

Hi, I'm actually working with BDC and I have to say I'm really disappointed about the documentation I found. So I have many questions and I hope some people will be able to help (at least partially) as I'm getting crazy. 1. When we have a BDC Data List WP with some filters is there a way to get ride of the filter "form" on top of the WP? 2. When we have a method with parameters in the ADF (a finder method). How are the parameters passed to the method (when we use a BDC Data List WP for example). How about programmatically? Is it necessary to associate a filter to the parameter (in the ADF)? 3. For an entity in the ADF is it possible to have more that one Finder/SpecificFinder method. If yes how the OOB WP manage it?

Passing a Text Value as DataView Filter Parameter

I have a dataview to which I would like to pass a text value for use as a filter.  My text value is on the same page within a DIV tag that I have given an ID.  When I view the page in the browser the text is actually rendered in a SPAN tag, within the DIV tag.  I have tried the ID for both the DIV and SPAN tags when setting up the parameter, and have tried using both a parameter type of Control and Form, but nothing I've tried is working. Any thoughts?  Thanks, Chanda

Parameter value filter based on user in SSRS (SharePoint Integration mode)


Hello..we have a reuirement where we have to filter the parameter value in the drop down based on the user who is accessing the report. We have form and Windows authenication enabled in the SharePoint site (some users will be from inside the network using windows and some will be accessing the site using internet using the Form Authentication).

Please let me know what would be the best way to handle this reuirement? Do we need to create a separate table  and store the User Information along with the parameter values they have access to, pass the userid from Report to db and then fileter the records using this table? OR Can we create a SharePoint List to maintain the user access information and then directly fetch the user information from the list using T-SQL to filter the records?

Please let me know your suggestion...


Filter DataTable


How can we filter a dataTable if we do not have a column name.

i.e using  column index..


Table-valued parameter and DataTable from ADO.NET


I'm going to use TVP:s to enhance performance in my c# .net fw 4 application which uses stored procs in SQL Server 2008. My first test was very successful and I inserted a batch of rows from by using a TVP in a stored proc. So far so good. Now to my question: when looking for the performance profit with SQL Profiler I saw it was really fast, but the generated sql-code made me a little bit confused. My "table" (DataTable class) from the .net-app was "retabled" like this in sql:

declare @table MyTvpType;

insert @table values (1, 2, 3...); ... x number of times

exec MyProc @table;

This was quite surprising, but when examining my .net code, I think there should be som way to "import" my MyTvpType into .net code, and avoid the extra delaration and inserts done as it is now. I'm using this code in .net:

Datetime filter value pass to BCS stored procedure parameter


I have data coming from one of the stored procedures that has startdate and enddate as parameters.I have created a business data webpart tht accepts this ECT.When I give the start date and end date in this format----> 2010-02-02 00:00:00Z,I can able to get the data from the database.

               As this is not a feasible approach,I have used a two datetime filters that has calendar control attached to it,so that user can use this to pick the start date and end date.Now,my issue here is when I choose the startdate and enddate,ECT is not accepting the format of the date that these filters are passing.I have changed the filter descriptor LOBDateTimeMode to "Local" in the external content type,but still I am receiving the same error.Does any one has any solution for this??

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.

How to filter XML recored with out using datatable or dataset.


hi there,

               i want filter data with out using Dataset or datatable, any one help me.



thanks to ypu

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

How to bind GridView and DropDownList controls using DataTable object

In .net framework 2.0, you can load a DataTable in memory by consuming a data source using a DataReader. In this version you will find the flexibility in accessing the DataReader means write access code once and use again and again using DataReader. To see the functionality of DataTable consider an example that is created using VS2005.

DataTable - Load from IDataReader - CreateDataReader - ReadXml WriteXml - Free ADO.NET Tutorials

The DataTable in ADO.NET 2.0 has been seriously beefed up and I absolutely love it. Not everything we consume deals with multiple resultsets and requires the ever popular DataSet. With the cool new features in the ADO.NET 2.0 DataTable, we can get many of the cool features in the DataSet without all the extra baggage and memory footprint particular to multiple resultsets.

Load DataTable from IDataReader

Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


Use a column as parameter for a sds in another column; gridview


Hola, I have a gridview which is bound to a sds which returns 7 columns and I added two columns from the GUI.  What I want is to fill up the 9th column with DDLs and these  DDLS will get their data from a different sds which is using a stored procedure with a single parameter.  I created the 9th row, used template field, made the sds for 9th row, the stored_procedure, threw a DDL in Item template and all  I need now is to pass a parameter in the first column to the sds in the 9th column.  I can code this but i'm getting tired of aspx.cs :) and would like to do it from the GUI.

Where to Filter the companies returned by the EF?



I am just starting with dynamic data. I have an enttity framework called UsersModel.edmx.

It returns a list of all companies in the tblCompany table. This list is really big.

I need to filter the list returned to all user controls on the client so that it only returns the company that have a CompanyTypeId= 2 or CompanyTypeId= 3 and company name != "".

1 - Is it possible to filter the company list returned on the server so that I can filter only once for all the controls that use that on the client?

My ideas was to do something like this using linq and lambda but I am not sure how:

return tblCompanys.Where(c => c.CompanyTypeId == 2 || c.CompanyTypeId == 3 && ).Where(c=>c.CompanyName != "").OrderBy(c => c.CompanyName).Distinct().OrderBy(c=>c.CompanyName);

2 - I have created a partial class and a metadata class and added the DisplayColumn attribute to use the company name and sort by company name ascending.

Could I use the code to filter the returned companies in this? where?

namespace MarsMedicalModel
    [DisplayColumn("CompanyName", "CompanyName")]
    public partial class t
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