472,371 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 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 1903

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: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.