ADO.NET :: DataTable.Compute Multiple Filter Expression?
Jan 10, 2011
I am doing some aggregates on in memory tables using the DataTable.Compute method. It works file if there is only one filter, however when there is multiples then it does not work.
This first one works fine the second one does not.
[Code]....
View 4 Replies
Similar Messages:
Jan 12, 2010
I have a problem with my asp.net program. I am doing a Datatable.compute on a very large database with a like condition in it. The result takes something like 4 minutes to show or does a Request timeout. If I do the same request with a = and a fix text, it takes nearly 1 minute to show, which for my use is acceptable.
Here is the line that is so slow:
float test = (int)Datatbl.Tables["test"].Compute("COUNT(pn)", "pn like '9800%' and mois=" + i + " and annee=" + j);
View 2 Replies
Jun 17, 2010
Dim dt As New DataTable Dim da As New SqlDataAdapter(s, c)
c.Open()
if Not IsNothing(da) Then
da.Fill(dt)
[code]...
When I call da.fill I am inserting all records from my query. I was then hoping to filter them to display only those where the GroupingID is equal to 0. When I run the above code. I am presented with all the data, the filter did not work. Please can you tell me how to get this working correctly.
View 1 Replies
Oct 15, 2010
I am using a GridView and I require the user to be able to filter using 2 controls. One simply filters the type of row - there is a column called action, and the user selects one of the distinct values from the database in a dropdown box, and the gridview only displays the rows with that value in the action column. On it's own this works perfect.
But I am also adding a textbox where the user can type in an ID of either the 'itemID', or the 'parentID'. This works fine even with the previous control.
Problem is, the dropdown box does not work when the textbox is empty (i.e. all ID's are being shown). If I choose a value and click Submit, it just doesn't do anything. Now if I am filtering by ID and then choose a value from the dropdown box, it works perfect.
Here is my filter expression and parameters of the datasource:
[Code]....
View 5 Replies
Feb 20, 2011
I have above 4,00,000 records. I have more searching options.
Is filter expression is good for better performance or I will build the query with WHERE condition?
Which process is better for searching in large amount of data?
View 1 Replies
Feb 10, 2011
Many times I need to manipulate with DataTable after I get data from database using adapter.Fill(table).
Usually I calculate data in DataTable by using loops. But I know that there is simpler way using LINQ. I know some basics about that just for strongly typed objects.I can't find how to do this with DataTable that is not strongly typed. How could I get all DataRow or Filtered DataTable (not just value for the field) from table for that conditions:
- where the specified field of the table contans MAX/MIN/AVG value,
- where the specified field of the table equals to some value.
View 1 Replies
Apr 12, 2010
I create a DataTable and filter it. When I use filter1, everything works as expected. When I use filter2, everything works as expected only if the SubsectionAmount variable is less than 10. s soon as I set SubsectionAmount=10, the dr2 array returns Nothing.
Imports System.Data
Partial Class FilterTest
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Loa
[code]....
View 2 Replies
Feb 10, 2010
How I can set the total recoreds at the gridview footer which has a Gridview AllowPaginning=true and RowFilter at A View which I bind it to the gridview
in other words how I can get the total records of the View {View of datatable} after applying the rowfilter expression on it.
View 4 Replies
May 7, 2015
I want search with multiple names in Name coloumn. example I have pass the criteria to Name cloumn is 'Atul', 'Mayur', 'Suraj' this three names how to pass in a query.
View 1 Replies
Sep 7, 2010
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")
View 5 Replies
Apr 18, 2010
Prior to adding paging using PagedDataSource I had dropdownlist and search box filters for my DataList. The guts of the code in aspx page for those parameters is below:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
[code]....
When creating the pager using PagedDataSource I did a tutorial which did not have parameters and all the code went in the code behind page. The guts of it is below:
private void BindGrid()
{
string sql = "SELECT [ProductCode], [ImgUrl], [Featuring], [Title] FROM [TableSG1] DESC";
[code]....
The pager is great but now I need to add my filters. The page wont load if I add the "SelectParameters" code (above) to my aspx page and if I simply add the "WHERE" clause to the "SELECT" clause in the code behind I get an error stating that I need to add a scalar variable.
I have found some examples through googling but nothing specific enough.
View 5 Replies
Apr 18, 2010
Prior to adding paging using PagedDataSource I had dropdownlist and search box filters for my DataList. The guts of the code in aspx page for those parameters is below:
HTML Code:
[code]....
The pager is great but now I need to add my filters. The page wont load if I add the "SelectParameters" code (above) to my aspx page and if I simply add the "WHERE" clause to the "SELECT" clause in the code behind I get an error stating that I need to add a scalar variable.
View 18 Replies
Aug 2, 2010
I've built a User Control that contains a ListView. To make it work I need to pass to it a DataTable. The columns of this DataTable need to have particular names that match up with what the ListView is expecting. I have a large DataTable that I need to massage/convert over to this different format. To do that I need to filter out columns and rename the column names. The actual data in the DataTable doesn't need to change. Is there a good way to do this without actually instantiating a new DataTable and copying the data from the large DataTable into it?
View 14 Replies
Jan 11, 2010
I would like to implement LINQ IN ASP.NET for filter required data from datatable. I have doubt that what is right place. I have following options
At presentation layer *.aspx.cs
At our Business layer.
At our Data base layer, where query for database happen which is return as a datatable to business layer. Business layer then return the result to presentation layer.right place for LINQ because now i have to further filter data from datatable as per user selecter filters.
View 4 Replies
Apr 7, 2010
i have a dataset which contains some data.
let dataset have some columns one among them is " Type "
let the values in column type be type1,type2.type3 and so on
now if i want to filter dataset which contains only type3
View 4 Replies
Mar 22, 2013
i could bind the data form tables to dropdownlist in asp .net using linq.
ex:
var res=from n in dc. contacts where n.location==Hyd select new{n.Id,n.Name};
var res1=from n in dc. Morecontacts where n.location==Hyd select new{n.Id,n.Name};
dropdown1.Datasouce=res;
dropdown1.DataTextField="Name";
dropdown1.DataValueField="Id";
[CODE]...
View 1 Replies
May 7, 2015
I am in need of filtering the datatable only with Month and Year .
I am able to perform this in SQL using
Year(date) =2015 and Month(date)= 5
How to perform this using Row Filter ...
View 1 Replies
Aug 18, 2015
I have a ListView with Checkbox. My requirement is - When I click on any checkbox then it should return all the columns values of that row on behalf of that CheckBox. After much study I came to know that using DataTable and DataRow I can get all data of particular ID of a Row. But I am unable to work with this. My code is something like below:
DataTable dt=new DataTable();
dt=objBAL.Get_ShoppingCartData();
ListView1.DataSource=dt.Tables[0];
[Code].....
View 1 Replies
Aug 19, 2010
How do you filter on more than one extension?
I've tried:
FileInfo[] Files = dinfo.GetFiles("*.jpg;*.tiff;*.bmp");
FileInfo[] Files = dinfo.GetFiles("*.jpg,*.tiff,*.bmp");
View 7 Replies
Oct 20, 2010
My requirement is to show a page with multiple filters to apply to grid data.
Suppose we are talking about Orders and an order has the following attributes
public class Order {
public int OrderID
public DateTime OrderDate
public DateTime ShipmentDate
public int OrderTotal
public int OrderStatus
}
Inside the jqgrid object I am showing all the attributes except the OrderStatus
The requirement is to create a view that has the jqGrid on the left part a panel on the right
Inside the right panel the user will see a list of checkboxes that represents every possible OrderStatus value and he want to search using both methods (for example selecting the checkbox "Shipped Orders" and then filtering the grid with Amount greater than a value)
I have already configured the advanced filtering (multiplesearch:true) inside the jqGrid object and I am able to create complex filters combining fields and logical operators.
how I can submit even the data from the right panel when the user press the search button?
Update 1:
Preamble: Oleg sample is fantastic but unfortunately does not fits requirements of my customer :(
@Oleg: I do not understand why you think that:
If the data are outside of the grid you will be show the order details on the right pane only for selected row. So the user will have not so good overview of the data.
maybe my description was not so clear but I am not going to show any order detail. To better clarify my requirement I have modified your sample to show you the desired final UI which is as in the following image:
The customer want to filter the data in the grid using two methods or both together:
Using the multiplesearch facilities provided by the grid itself (thanks for the workaround mention) Using the custom Search Panel (the one with the checkboxes on the right) provided
From a functional point of view the requirement is very easy to express: When the user click on a checkbox or make a search using the native multiplesearch I should post values to the server including also the checkboxes state.
To summarize I should:
Add the checkboxes state when a post is made through the native multiplesearch
Add the current multiplesearch state (if any) when the user click on a checkbox
View 2 Replies
Jan 29, 2010
in my application i am checking the valid email but we can give more than one emailid separating with semicolon (";").how can i write the expression. my emails look like this "sasidhar@yahoo.com;suryasasidhar@gmail.com;srinivas@gmail.com "
how can i write regular expression
View 2 Replies
May 7, 2015
I am storing DataTable inside "Application Object" in .aspx page:
DataTable dt = new DataTable();
dt.Columns.Add("SenderUser");
dt.Columns.Add("RcvUser");
[Code]....
Now, I want to filter DataTable of .asmx page, based on Receiver user (dr["RcvUser"]) defined in .aspx page Example:
I want to filter Datatable based on below condition:
if(dr["RcvUser"] == Session["UserName"])
How to achieve it. I am using Framework 2.0
View 1 Replies
Jun 16, 2015
i have 4 dropdown controls.i have to search for data from ms-sql by selecting the dropdownd if dropdown has all values then ihow an i write query in where condition?
View 1 Replies
May 7, 2015
I saw link [URL] ....., that is great , so i have one query .
How to filter gridview with 4 checkboxlists for Product search
CheckboxList2 -DISCOUNT CheckboxList3 - Price CheckboxList4 - BRAND CheckboxList5 - Category
but one think is that without removing any checked data on checkboxlist when select any checkboxlist item. like snapdeal,flipkart etc ....
View 1 Replies
Aug 5, 2010
I am working on an auto trade website. On the page where Ad list gets displayed, I plan to display the number of Ad for different categories: for example, for location: I will display something like "Vancouver (50), Richmond (12), Surrey (20)". For vehicle make, the following will be shown "Honda (20), Ford(12), VW (24)".
I am not sure if I should pull ALL the ad from the db into a List first, bind one page of the result to gridview control, and then compute stats for each category using Linq. if course I will limit the number of rows pulled from the db using some kind of condition - maybe set the MAX # of rows to be returned as 500.
My major concern is - is this going to be a memory hog?
View 1 Replies