C# - Datatable.compute Slow With Like Condition?

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


Similar Messages:

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

ADO.NET :: Very Slow In Getting A Datatable From Filling An Adapter ?

Nov 2, 2010

what i have is the following code.

[code]...

View 2 Replies

Forms Data Controls :: Export Datatable To Excel 2007 Is Very Slow

Mar 21, 2011

When i export the data table to excel 2003 i get the output in a very fast manner and when i want to use the same in excel 2007 debugging gets stopped and nothing happens.... It does not show any errror on it to. When i slowly debugged i find that in saveas() it takes longer time and it seems like execution gets stopped in this process.

Its like in new window it shows loading for more than 10 min and after some time the particular window gets closed and nothing happens can anyone tell me what can be wrong.When the same code works great when i export to 2003.

View 5 Replies

Pull Everything From Db And Then Compute Stats?

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

Auto Compute Wheck Check In Repeater

Apr 13, 2010

I have a repeater that display a customer's bill. Now, the customer has the option to select which of the account he/she will pay. Therefore, in my interface, I have a checkbox in my repeater. All I wanted is to compute for the total amount to pay based on the selected checkboxes. Below is my code for my repeater under ItemTemplate.

Code:
<ItemTemplate>
<tr>
<td style="border: 1px solid #000;">
<asp:CheckBox ID="chkEntryCode" Text='<%# DataBinder.Eval(Container.DataItem, "Code") %>' runat="server" />
</td>
<td style="border: 1px solid #000;">
<asp:Label ID="lblRequestID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "requestid") %>'></asp:Label>
</td>
<td style="border: 1px solid #000;"><%# DataBinder.Eval(Container.DataItem, "Description") %></td>
<td style="border: 1px solid #000;">
<asp:Label ID="lblAmount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Amount") %>'></asp:Label>
</td>
</tr>
</ItemTemplate>

And for me to compute for the amount to pay based on the checked checkboxes. I have the following code.

Code:

protected void rBill_ItemCommand(object source, RepeaterCommandEventArgs e)
{
double dAmountToPay = 0;
for (int i = 0; i <= rBill.Items.Count - 1; i++)
{
CheckBox chkItem = (CheckBox)rBill.Items[i].FindControl("chkEntryCode");
Label lblAmount = (Label)rBill.Items[i].FindControl("lblAmount");
if (chkItem.Checked)
dAmountToPay = dAmountToPay + double.Parse(lblAmount.Text);
}
lblTotalAmount.Text = dAmountToPay.ToString();
}

Well, based from the code I provided, there's nothing happens at all.

View 4 Replies

Forms Data Controls :: Compute In Gridview

Mar 17, 2011

I have a question, I have a Gridview with the field Description, quantity, Price per Unit, How can I compute (Quantity)*(Price per Unit ) = () on the gridview?

View 4 Replies

JQuery :: Compute JSON In JTemplate In Webservice Manually?

Mar 31, 2011

I have a webservice which retrieves data from another external service. The data is already in JSON Format. So I retrieve it and set it to the return value (type: string) of my webservice. But according to firebug the webservice then encapsulates the provided JSON-Data with a backslash, e.g. it returns:

[Code]....

instead of

[Code]....

But the JSON provided by the external service is correct. So how could I provide the correct string to jTemplate from my Webservice?

View 4 Replies

Forms Data Controls :: Add Compute Column For Set Of Rows Inside A Gridview?

Feb 28, 2011

I am having an requirement of displaying the records in the following way in the gridview.

Division
Region
Amount

North
Region1
123

North
Region2
124

North
Total
247

South
Region1
123.......

View 3 Replies

Forms Data Controls :: Compute The Result From The Quiz Inside The Gridview?

Feb 1, 2011

i have a column named POINT.. it is the point in every question... therefore i want to get the total of this column..

View 3 Replies

Error "DataTable Is An Ambiguous Reference Between System.Data.DataTable And Microsoft.Office.Interop.Word.DataTable"

Jan 20, 2011

'DataTable' is an ambiguous reference between 'System.Data.DataTable' and 'Microsoft.Office.Interop.Word.DataTable'

View 3 Replies

Forms Data Controls :: Compute Values In FormView From Row Data?

Oct 18, 2010

Here's what I am trying to do:

Inside Form View Want to display the average of a field based from field1/field2

ie:)

Field 1 = 10
Field 2 = 5
Field 3 would equal 2 (Field 1 / Field 2)

How would I go abaout doing this. Code currently looks like:

[Code]....

Using custom bind expression in the formview but it won't let me do this..

View 4 Replies

Pass Datatable To The Mvc View Error / CS0246: The Type Or Namespace Name 'DataTable' Could Not Be Found

Sep 28, 2010

I was reading: [URL]

But I have give a compilation error:

CS0246: The type or namespace name 'DataTable' could not be found (are you missing a using directive or an assembly reference?

View 1 Replies

DataSource Controls :: How To Copy The Data From One Datatable To Another Datatable Based On The Schema

Jan 11, 2010

i have the dataset with one table.Table contains three column like 'Name','Location','Pin'.I would like to move the data from another table based on schema.

View 2 Replies

Forms Data Controls :: Set A Column In A DataTable To Be A Primary Key For An Existing Datatable

Apr 2, 2010

If I am passed a datatable and I cant change the column structure..is there anyway to set an existing column to a Primary key so I can easily Find() the row I am looking for?

View 1 Replies

Data Controls :: Copying Specific Records From One Datatable To Another Datatable

Aug 22, 2012

im trying to copying specific record from one datatable to another datatable i used below code

public System.Data.DataTable selectspecificdatarow(System.Data.DataTable dtg, int count, int startindex)
{
System.Data.DataTable dtn = dtg.Clone();
for (int i =startindex; i < count; i++)

[Code]....

its taking too long time in cloneing is there any better way to do this task which is Time effecent

View 1 Replies

C# - How To Join Two Datatable Datas Into One Datatable To Show In One Gridview

May 24, 2010

how to join two datatable datas into one datatable to show in one gridview

i.e in 1 datatable i have username and pwd and in another datatable i have that user details. how to show all these in one datatable to get those values display in gridview(asp.net)

View 4 Replies

Asp.net - How To Correctly Filter A Datatable (datatable.select)

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

How To Copy Data From Datatable To Dataset.datatable

Oct 31, 2010

how to copy data from datatable to table in dataset i ry this but its readonly property

ds.datatable1=newdt.copy

View 1 Replies

ADO.NET :: Find Rows In One DataTable From Another DataTable And Remove Them

Sep 9, 2010

I have a DataTable of available time slots. I have another DataTable of reserved time slots. I need to remove from the list of available slots the ones that have been reserved. The blocks are in 15 minute increments, but one of my problems is that the reservation can be longer than 15 minutes. I've had some luck removing one or two, but not all of the required columns.

Here's my code (it doesn't work right now).

[Code]....

View 1 Replies

DataSource Controls :: How To Get Records In 1st DataTable But Not In 2nd DataTable

May 14, 2010

I have two datatables, I want to get all records which are in one datatable but all matching records which exist in another datatable should not be available.

In terms of set, you can say that record which are in 1st datatable but not in 2nd DataTable.

View 13 Replies

C# - How To Copy Only The Columns In A DataTable To Another DataTable

Jun 1, 2010

how to copy only the columns in a DataTable to another DataTable?

View 2 Replies

C# - Datatable Subset Of Columns From Another Datatable

Jul 2, 2010

I have a datatable with 17 columns and a bunch of data. I wnat a datatable with only 6 of the columns and the data for those 6 columns. So I need a subset of the original datatable. How do I loop through the original datatable with 17 columns and end up with a datatable with only the 6 columns I want with the corresponding data for those 6 columns?

View 4 Replies

ADO.NET :: How To Build A New DataTable From Existing DataTable

Mar 11, 2011

Below is a beginning attempt to increment through a DataTable populated by a Stored Procedure and create a new DataTable where every Category is represented by exactly four products. I need to add dummy product entries for some and skip over those with over four products.

A) - I think I understand the basics but this builing from scratch is not my practice.
1) I do not know how to query a previous row in reference DataTable.
2) I do not know how to jump to next row from IF construct.
3) I hope I am able to build a DataTable row by row.
4) Partial sample data is at bottom of pseudo code

[Code]....

View 6 Replies

When To Use The Try Catch Condition

Feb 23, 2010

Do I have to use the 'Try Catch' condition or possibly find ways to catch the error myself? Do you use the Try Catch all the time, when, why not?

View 7 Replies







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