Datagrid Binding

lameness

Member
Joined
Jun 6, 2008
Messages
5
Programming Experience
Beginner
Hello,

I have a data grid that shows search results from a rather large database. What i want to do is to provide a msgbox prompt so that after a certain amount of time has expired (running the search) the user is given the option of terminating the search. How would i do this?

This is not an issue with the commandTimeout of the sql. The dataset is being populated in very little time, however binding the results to the datagrid can take a long time.

I have had a few testers with using a timer to monitor the time elapsed, but i cant get it to work as the populating of the datagrid seems to prevent the timer from ticking. Please, this is driving me mad, it must be a common problem but i cant see how to fix it.

Any help would be great.
 
This is not an issue with the commandTimeout of the sql. The dataset is being populated in very little time, however binding the results to the datagrid can take a long time.

Couple of things here... are you sure that the population is so quick and the display so slow? Howcome? I've never seen the display take longe rthan the fetch

The other thing is.. if your DGV is taking a long time to show the data, is it because you have millions of rows? I've loaded a thousand rows into a DGV in less than a second many times before now. Remember: it's not good HCI to even load a thousand rows, let alone millions
 
Thanks for the reply.

The HCI side of things isnt really my concern as this is purely a read-only display for a db that already has a non-read only front end. I have basicly copied the layout of the existing search page (in vb6)....because that is what was wanted...they didn't want to change.

However the non-read only version accessed a smaller db....my read only version is accessing the archive db and so it will have millions of entries. Trying to limit the number of reurned results is what i have been concerned with.

I have already made various prompts so as to warn the user if they may not be sufficiently filtering their search. As the data Set also populates in a matter of seconds (about 5 secs for 100k records) i warn the user as to how many records they are trying to view...and let them stop.

However i also wanted to add some timer or something that can monitor how long it takes to populate the datagrid; it is this populating that is taking the time.....about 50secs for 5k of records.

Im new to this and not sure exactly what i can do for this timer. I dont know how i can stop the dg population mid way through.

At the moment i populate and dataview with a max of 5k records and pop the dg with that. Once that is done i ask the user if they want more...The trouble is that if they say yes...(prolly wont i know) then you have to re-pop the dataview and dg only this time with even more records.

At the moment it would be really good if someone could tell how (if possible) to concatinate the datagrid so that say if 5 k records are alrady in it and the user wnats more...then you can just add another 5k without needing to re - pop it all again only this time with say 10k records.


I hope this makes sense....sorry if it doesn't, like i said im new to this.
As for what you say about how you find it unlikely that the datagrid pop is taking so long...well i dont know what to say expcet that it def is the case.

Its the

frmArchive.DataGridView1.DataSource = dv

line that takes the time...the sql timeout is set at 10secs and never trips.

I will stop rambling....Thanks for taking the time to read.
 
In .NET 2 we would make a typed dataset, and drop it on a form, and the IDE makes a grid, bindsource and datatable instance for us, then we fill the existing instance rather than assigning a new one to .DataSource.

I suggest you follow the pattern, because even my queries of 1000s of records havent taken so long to show when i fill a data model that is already linked

For a tutorial see the DW2 link in my sig, section "Creating a SImple Data App"
 

Latest posts

Back
Top