|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Winforms DataGrid with a 41,000+ records.I have a DataGrid (winforms) that is bound to a table (MSDE) that has
41,000+ records in it. The form loads relatively fast and I can scroll all of the data... However, when I click in any column of any row other than the first one, it takes forever to go to that row, even if it's just the next one. So I limited the query to only a certain set of data which returned a little less than a thousand records and the form shows at the same speed, but when I click in a row, it passes for a few seconds.. So I know it's an issue with the amount of data... If I can see all the data on the grid, shouldn't it be just as fast to move from row to row as it would if it only had a few records in it? Is there something I need to do differently? Aaron -- --- Aaron Smith Remove -1- to E-Mail me. Spam Sucks. Yes, you shouldn't be loading thousands of records. You are not supposed to
use the datatable as an in memory dataset. You are supposed to load the data it needs into it, and have your grid display it. Show quote "Aaron Smith" <thespirit***@smithcentral.net> wrote in message news:Q0mud.7188$nE7.658@newssvr17.news.prodigy.com... > I have a DataGrid (winforms) that is bound to a table (MSDE) that has > 41,000+ records in it. The form loads relatively fast and I can scroll > all of the data... However, when I click in any column of any row other > than the first one, it takes forever to go to that row, even if it's > just the next one. So I limited the query to only a certain set of data > which returned a little less than a thousand records and the form shows > at the same speed, but when I click in a row, it passes for a few > seconds.. So I know it's an issue with the amount of data... If I can > see all the data on the grid, shouldn't it be just as fast to move from > row to row as it would if it only had a few records in it? Is there > something I need to do differently? > > Aaron > -- > --- > Aaron Smith > Remove -1- to E-Mail me. Spam Sucks. Actually, I found the problem and it works fine now. Thanks anyway.
Marina wrote: Show quote > Yes, you shouldn't be loading thousands of records. You are not supposed to > use the datatable as an in memory dataset. You are supposed to load the > data it needs into it, and have your grid display it. > > "Aaron Smith" <thespirit***@smithcentral.net> wrote in message > news:Q0mud.7188$nE7.658@newssvr17.news.prodigy.com... > >>I have a DataGrid (winforms) that is bound to a table (MSDE) that has >>41,000+ records in it. The form loads relatively fast and I can scroll >>all of the data... However, when I click in any column of any row other >>than the first one, it takes forever to go to that row, even if it's >>just the next one. So I limited the query to only a certain set of data >>which returned a little less than a thousand records and the form shows >>at the same speed, but when I click in a row, it passes for a few >>seconds.. So I know it's an issue with the amount of data... If I can >>see all the data on the grid, shouldn't it be just as fast to move from >>row to row as it would if it only had a few records in it? Is there >>something I need to do differently? >> >>Aaron >>-- >>--- >>Aaron Smith >>Remove -1- to E-Mail me. Spam Sucks. > > > -- --- Aaron Smith Remove -1- to E-Mail me. Spam Sucks. So can you describe what the problem was so the rest of us can learn from
it? Show quote "Aaron Smith" <thespirit***@smithcentral.net> wrote in message news:yjnud.7216$nE7.5369@newssvr17.news.prodigy.com... > Actually, I found the problem and it works fine now. Thanks anyway. > >> "Aaron Smith" <thespirit***@smithcentral.net> wrote in message >> news:Q0mud.7188$nE7.658@newssvr17.news.prodigy.com... >> >>>I have a DataGrid (winforms) that is bound to a table (MSDE) that has >>>41,000+ records in it. The form loads relatively fast and I can scroll >>>all of the data... However, when I click in any column of any row other >>>than the first one, it takes forever to go to that row, even if it's >>>just the next one. So I limited the query to only a certain set of data >>>which returned a little less than a thousand records and the form shows >>>at the same speed, but when I click in a row, it passes for a few >>>seconds.. So I know it's an issue with the amount of data... If I can >>>see all the data on the grid, shouldn't it be just as fast to move from >>>row to row as it would if it only had a few records in it? Is there >>>something I need to do differently? Heh. I didn't want to be embarassed.
When I originally wrote that form, we were working with the philosophy of every time they move to a new row, we were going to save any changes, and then update the grid in case someone else added or deleted entries. Since then, the bosses decided that they would rather have people make a bunch of changes, then click save to update the SQL Server tables. I forgot to change the form before I imported the data, and to top it all off, I wasn't checking for changes, I was just updating, then calling fill of the dataadapter and resetting the datasource of the grid. So every time you try to move or click in another row, it was running that save and refresh routine. Nice huh? I spent over an hour trying to figure out how to do some sort of paging routine when it was just me being an idiot. Once I took that routine out, everything was fine. It gets frustrating when you've only been doing stuff in ADO.Net for about 3 weeks now and the last time I used regular ADO was about 4 years ago. So half the time, everything I do is a shot in the dark. :P Wayne Godfrey wrote: Show quote > So can you describe what the problem was so the rest of us can learn from > it? > > > "Aaron Smith" <thespirit***@smithcentral.net> wrote in message > news:yjnud.7216$nE7.5369@newssvr17.news.prodigy.com... > >>Actually, I found the problem and it works fine now. Thanks anyway. >> >> >>>"Aaron Smith" <thespirit***@smithcentral.net> wrote in message >>>news:Q0mud.7188$nE7.658@newssvr17.news.prodigy.com... >>> >>> >>>>I have a DataGrid (winforms) that is bound to a table (MSDE) that has >>>>41,000+ records in it. The form loads relatively fast and I can scroll >>>>all of the data... However, when I click in any column of any row other >>>>than the first one, it takes forever to go to that row, even if it's >>>>just the next one. So I limited the query to only a certain set of data >>>>which returned a little less than a thousand records and the form shows >>>>at the same speed, but when I click in a row, it passes for a few >>>>seconds.. So I know it's an issue with the amount of data... If I can >>>>see all the data on the grid, shouldn't it be just as fast to move from >>>>row to row as it would if it only had a few records in it? Is there >>>>something I need to do differently? > > > -- --- Aaron Smith Remove -1- to E-Mail me. Spam Sucks. I understand your frutstration! Thanks for sharing.
Show quote "Aaron Smith" <thespirit***@smithcentral.net> wrote in message news:63pud.7243$nE7.5221@newssvr17.news.prodigy.com... > Heh. I didn't want to be embarassed. > > When I originally wrote that form, we were working with the philosophy of > every time they move to a new row, we were going to save any changes, and > then update the grid in case someone else added or deleted entries. Since > then, the bosses decided that they would rather have people make a bunch > of changes, then click save to update the SQL Server tables. I forgot to > change the form before I imported the data, and to top it all off, I > wasn't checking for changes, I was just updating, then calling fill of the > dataadapter and resetting the datasource of the grid. So every time you > try to move or click in another row, it was running that save and refresh > routine. Nice huh? I spent over an hour trying to figure out how to do > some sort of paging routine when it was just me being an idiot. Once I > took that routine out, everything was fine. > > It gets frustrating when you've only been doing stuff in ADO.Net for about > 3 weeks now and the last time I used regular ADO was about 4 years ago. So > half the time, everything I do is a shot in the dark. :P > > Wayne Godfrey wrote: >> So can you describe what the problem was so the rest of us can learn from >> it? >> >> >> "Aaron Smith" <thespirit***@smithcentral.net> wrote in message >> news:yjnud.7216$nE7.5369@newssvr17.news.prodigy.com... >> >>>Actually, I found the problem and it works fine now. Thanks anyway. >>> >>> >>>>"Aaron Smith" <thespirit***@smithcentral.net> wrote in message >>>>news:Q0mud.7188$nE7.658@newssvr17.news.prodigy.com... >>>> >>>> >>>>>I have a DataGrid (winforms) that is bound to a table (MSDE) that has >>>>>41,000+ records in it. The form loads relatively fast and I can scroll >>>>>all of the data... However, when I click in any column of any row other >>>>>than the first one, it takes forever to go to that row, even if it's >>>>>just the next one. So I limited the query to only a certain set of data >>>>>which returned a little less than a thousand records and the form shows >>>>>at the same speed, but when I click in a row, it passes for a few >>>>>seconds.. So I know it's an issue with the amount of data... If I can >>>>>see all the data on the grid, shouldn't it be just as fast to move from >>>>>row to row as it would if it only had a few records in it? Is there >>>>>something I need to do differently? >> >> >> > > > -- > --- > Aaron Smith > Remove -1- to E-Mail me. Spam Sucks. |
|||||||||||||||||||||||