|
Yeah, the original concern was preventing UI lag which is why we suck down tables at once. But yeah, this is a multi-user system, so if someone leaves the UI open for a long period of time because they don't like the startup cost, the data could be stale.
|
|
|
|
|
Some of the other large tables, I load "on demand" because I don't really need that data most of the time. I definitely need Table1, but that only has like 5 rows, so no biggie. Table2 has the Table1 -> Table3 (1:M) relationships.
If I say open Table1.Row1Entity then I only really need a subset of Table2 and a subset of Table3, but we are still talking ~350 rows at that level.
Now there is a further level of objects in the tree (this is the 250,000 rows)... I guess I don't need all 250,000 at once, but its going to be around 350 x 108, so 37000 rows when I open Table1.Row1Entity. The 37000 rows are obviously not all displayed at once, so I guess technically I could only grab 108 at a time.
Hmm... I guess there are some optimizations I can make in regards to loading only subsets of data, but I certainly don't want to introduce "pauses" in the UI. I'd rather have 1 pause at startup and have it fast from then on...
Not sure if loading ~300 rows at a time would introduce UI lag?
|
|
|
|
|
loading 1000 rows should be fine, unless your data structure really isn't appropriate and requires a very complex and expensive query returning few results. Such was not suggested by your message.
I suggest you just give it a try with a mock query.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Nope. I only have around 10 stored procs. Everything else is done with parent / child relationships, cascades, etc.
I'll give it a whirl.
|
|
|
|
|
Luc Pattyn wrote: I suggest you just give it a try with a mock query.
The old "Suck it an see" approach!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
No, get the foundation right.
Spend 1% of your time to make sure you're not about to waste the next 99% of it and ruin your schedule.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
On the drive home I came to the realization that I kind of do something similiar to this already.
In our multi-user environment, we have the concept of check-in and check-out of objects. When you check-out an object, it checks-out all the child objects as well and obviously does a "get latest" in the process. This "get latest" code is what I would need to do in this "speed up" mechanism when the user opens the outer most object.
The check-out process does quite a bit to refresh all the dependent objects. You have to grab all the latest dependent objects kind of from the bottom up so you don't run into RI problems. In case you are going to ask, no, I don't get them one at a time . I wrote a few optimized stored procedures that do inner joins to retrieve various levels of dependent objects at once. So we are probably talking about 4 stored procs to refresh the outer most object and all its dependent objects.
Anyways, the last time I ran a timer on a check-out of the outer most object, I think it took 1 - 3 seconds.
So if I only grab subsets of data, I'd introduce a 1 - 3 second delay.
Not much I can do about that I don't think. I think I ran a profiler on the code and saw most of the overhead was just calling the stored procs and merging the data back into the tables.
|
|
|
|
|
If it is a matter of seconds, the user won't mind. And you can humor him by showing a nice splash screen...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks...
I originally implemented it to load full tables to prevent "UI lag". Unfortunately users of the system "abused" the original intent and a few of the tables ballooned to 250k rows :p.
I took your advice and changed it over to just load the chunks of data as they are needed.
Start up time went from 45seconds on my local machine -> 1 to 2 seconds. No noticable UI lag since I'm just loading a few hundred rows.
Offshore guys in India were reporting 5 *minute* start up times. Hopefully they are happier now. I haven't heard how long it takes them now though.
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
You can not do much if you want to load all the 250K rows. Only thing you can try is loading as much as needed instead of loading all the tables.
Hope this helps.
All the best.
|
|
|
|
|
I need to read emails in Exchange 2010, the move them to another folder. I have the POP3 code done to read the email, but I can't seem to find any examples of how to move the message to another folder.
Anyone know how to do this?
Everything makes sense in someone's mind
|
|
|
|
|
Maybe last week's discussion[^] can help you out.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
On top of Luc's reply, this[^] weeks discussion might also help.
|
|
|
|
|
Hi friends can any body tell me how i can get the information of hardware devices like soundcard and other hardware driver information Using C#
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
Check out this[^] useful article from the CodeProject archive.
|
|
|
|
|
This Article[^] might help you.
you can also navigate this link[^] having same question with solutions.
|
|
|
|
|
Hello Everybody,
I have a table Tbl_Balance in Which have records of Emp. Have a Look of Table.
Empid ABalance
----- --------
BC101 23000
BC102 -1500
BC103 50000
BC105 -4220
Now I want to show these records in DataGridView like this :
Empid ABalance
----- --------
BC101 23000 DR
BC102 1500 CR
BC103 50000 DR
BC105 4220 CR
How can it possible with the help of DataTable Or Dataset.
Thanks
If you can think then I Can.
|
|
|
|
|
I'm pretty sure there will be an item or row binding event raised by the grid view (without knowing which one you are using, I couldn't possibly narrow it down). In this binding event, you should be able to get the details of the relevant cell and handle it accordingly. If you were using WPF, I'd recommend using a Value Converter to handle it.
Alternatively, you could use a calculated column in your data table (I wouldn't recommmend it, but you could).
|
|
|
|
|
I suggest you read up on the DataGridView.CellFormatting event.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
When you use the next code
Math.Round(5.515* 0.05, 2,MidpointRounding.AwayFromZero)
the result is 5.52
with
Math.Round(6.515* 0.05, 2,MidpointRounding.AwayFromZero)
the result is 6.52
with
Math.Round(7.515* 0.05, 2,MidpointRounding.AwayFromZero)
the result is 7.52
......
but with
Math.Round(4.515* 0.05, 2,MidpointRounding.AwayFromZero)
the result is 4.51
|
|
|
|
|
galache wrote: Math.Round(4.515* 0.05, 2,MidpointRounding.AwayFromZero) the result is 4.51
Very interesting but how do you account for this when the result of 4.515* 0.05 is 0.22575 ?
I think there may be something wrong in your code.
I must get a clever new signature for 2011.
|
|
|
|
|
Sorry, the code is:
Math.Round(4.515, 2, MidpointRounding.AwayFromZero)
the result is 4,51
other example whit decimal type
Math.Round(4.515m, 2, MidpointRounding.AwayFromZero)
the result is 4,52
I think the problem is the double type use in the first example
Thanks
|
|
|
|
|
galache wrote: I think the problem is the double type use in the first example
Yes, one of the inherent problems of representing floating point (and double) values in binary is that they tend to lose accuracy after the decimal point, as they can only be approximations of decimal numbers.
I must get a clever new signature for 2011.
|
|
|
|
|
Hello Everybody,
I have two tables Emp and Dept in DataSet. In which have followind fields.
Emp Dept
---- --------
Emp_No Emp_No
Emp_Name Dept_No
Emp_Sal Dep_Name
Now i want the result in datagridview from both dataset. Result will be look like this.....
Result_In_dataGridview
-----------------------
Emp_no Emp_Name Emp_Sal Dept_no Dept_Name
So please describe me how can i do that by using Code.
Thanks
If you can think then I Can.
|
|
|
|