joe_pool_is Posted July 23, 2009 Posted July 23, 2009 I've built an application that reads data from a table, and populates that data into a series of DataGridView (DGV) controls. DataTable table = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(sqlText, sqlConnection); da.Fill(table); DataGridViewX.DataSource = table.DefaultView(); Simple. There is a lot of data, so I've had to limit the amount that I read in, because I can quickly exceed WinXP's 2GB per user limit. In Task Manager, I can see that my App takes up about 17MB (megabytes) while at the IDE, jumps to roughly 24MB in debug mode, then quickly approaches my limit as I pull in data from tables. What I'm working on to keep pulling in data is to take each table and export it to an Excel file in the next (unshown) line of code. For now, the DGV controls are still there. Here's the interesting part: Say I pull in 7 tables (which I did recently), populate 7 different DGV controls and create 7 different Excel files. It all works, but Task Manager now shows that my App is at about 1.7GB whereas the folder where I saved the Excel files shows that all 7 files only add up to about 25MB. Why are the DGV controls so bloated? I know they are powerful and fast, but does this mean they store multiple versions of the data in memory or something? Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.