473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Data retrival time and combo load

kk
Have 2 problems, any help is appreciated.

Tab with Grids
--------------
BL - fetching data from DB ( 5 secs - 10 rows)
Grid Laod - 20 secs
Grid Paint on tab change - 20 secs

Problem: The data fetch only takes 5 secs, why does paint
and load take 40 secs in total.
Is there any reason why it is very slow.
Combo loads
-----------
Combo loaded with data binding using a collection of
business layer objects, how can we add a string
named 'ALL' to the combo box without creating an empty
object and adding it to the array collection.

Thanks,

Jul 21 '05 #1
2 1994

first issue... don't know. send code sample.
2nd issue - after binding add a new item.
mycbobox.Items.Insert(intPosToInsertAt,"ALL")

Nick Harris, MCSD
http://www.VizSoft.net

"kk" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Have 2 problems, any help is appreciated.

Tab with Grids
--------------
BL - fetching data from DB ( 5 secs - 10 rows)
Grid Laod - 20 secs
Grid Paint on tab change - 20 secs

Problem: The data fetch only takes 5 secs, why does paint
and load take 40 secs in total.
Is there any reason why it is very slow.
Combo loads
-----------
Combo loaded with data binding using a collection of
business layer objects, how can we add a string
named 'ALL' to the combo box without creating an empty
object and adding it to the array collection.

Thanks,

Jul 21 '05 #2
kk
Thank you for the prompt reply.

1st issue :
--------------------------------------------------------
Loading Grid
------------
1) creating new rows in a datatable and adding data a
array list to datatable.

ArrayList arrData = new ArrayList();
arrData = Employee.GetAll();

DataTable dt = new DataTable();
DataRow dr = new DataRow();
for(i=0; i< arrData.Count; i++)
{
dr = dt.NewRow();
dr["Age"] = ((Employee)arrData[i]).Age;
dr["Name"] = ((Employee)arrData[i]).Name;
dr["Object"] = arrData[i];
}

2) From datatable populating the grid
Total time taken for this is 40 secs.
Grid.DataSource = dt;

Clicking on tabs at runtime with grids in each tab
--------------------------------------------------
3) Even though the grid is loaded with data, it takes
full 20 secs for the grid to show on each tab when
switching between tabs at runtime. Grid painting is
time consuming.

2nd issue:
----------------------------------------------------------
Tried the InsertAt after the data binding and it did not
work, complained that positions for items cannot be
changed. Also tried inserting before the binding,
although there were no runtime errors, the "All" entry was
overwritten by the databinding.

public static void LoadCombo(System.Windows.Forms.ComboBox
cbo, ICollection data, string display, string key)
{
ArrayList arData = (ArrayList) data;
if (arData.Count == 0)
{
cbo.DataSource = null;
}
else
{
cbo.DataSource = arData;
cbo.DisplayMember = display;
cbo.ValueMember = key;
cbo.Items.insert(0,"All"); -- Did not work
}
-----Original Message-----

first issue... don't know. send code sample.
2nd issue - after binding add a new item.
mycbobox.Items.Insert(intPosToInsertAt,"ALL")

Nick Harris, MCSD
http://www.VizSoft.net

"kk" <an*******@discussions.microsoft.com> wrote in messagenews:03****************************@phx.gbl...
Have 2 problems, any help is appreciated.

Tab with Grids
--------------
BL - fetching data from DB ( 5 secs - 10 rows)
Grid Laod - 20 secs
Grid Paint on tab change - 20 secs

Problem: The data fetch only takes 5 secs, why does paint and load take 40 secs in total.
Is there any reason why it is very slow.
Combo loads
-----------
Combo loaded with data binding using a collection of
business layer objects, how can we add a string
named 'ALL' to the combo box without creating an empty
object and adding it to the array collection.

Thanks,

.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Frazer | last post by:
hi i have a combo box which i populate with all tables from northwind database and when the user selects an item from the combo, i want to populate the datagrid with data from that table. ...
2
by: Jeremy Dillinger | last post by:
I have a program setup to pull data from a database. My database table has things such as (category, Item, price, etc.) In my program I want to have multiple list boxes that will have a pull down...
2
by: kk | last post by:
Have 2 problems, any help is appreciated. Tab with Grids -------------- BL - fetching data from DB ( 5 secs - 10 rows) Grid Laod - 20 secs Grid Paint on tab change - 20 secs Problem: The...
3
by: Chris H | last post by:
Ok in the following code I am trying to have my keywards meta tag auto insert the top 10 titles from most recently added database entries, right now the while loop is only setting the $keyword...
3
by: rlm | last post by:
This small problem to solve involves a two table database (one parent and one child table), one winform and two combo boxes. Combo box A is populated in the Load event. Combo box A pulls data...
0
by: Gian Paolo | last post by:
this is something really i can't find a reason. I have a form with a tabcontrol with tree pages, in the second page there is a Data GRid View. Plus i have a class. When i open the form i...
2
by: WB | last post by:
I have an app that will need to store hostorical data (path & filenames) in a combo box (so that the user doesn't have to type in the same data each time the app is restarted). Is it best to keep...
3
by: Max | last post by:
Hello, I made a windows form with a combo box and 4 text boxes. All 5 objects should get their data from a data set which is populated in the form load method. The combo box has item ids. When...
10
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi, Problem: How can I databind (or put) a SqlServer query's row return of 115,000 items into a ComboBox quickly? Not much longer than a matter of seconds, that is... Scenario: I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.