how to speedup program load

  • Thread starter Thread starter TM
  • Start date Start date
T

TM

I have a small application that displays records from an access mdb into two
datagrids and am looking to see if it is possible to speedup the loadtime
somehow.

In my formload I am filling my dataset and binding it to the datagrids. Is
there a better place to get my grids loaded and speed up the program
loadtime ?

Thanks
 
You can use the NGEN (CLR Native Image Generator) utility for this.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfNativeImageGeneratorNgenexe.asp
The Native Image Generator creates a native image from a managed assembly
and installs it into the native image cache on the local computer. The
native image cache is a reserved area of the global assembly cache. Once you
create a native image for an assembly, the runtime automatically uses that
native image each time it runs the assembly. You do not have to perform any
additional procedures to cause the runtime to use a native image. Running
Ngen.exe on an assembly allows the assembly to load and execute faster,
because it restores code and data structures from the native image cache
rather than generating them dynamically.


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
Alternatively, it may be worth looking at a DataReader to get the data from
your Database into the DataSet/Table

OHM#



Jan said:
You can use the NGEN (CLR Native Image Generator) utility for this.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfNativeImageGeneratorNgenexe.asp
The Native Image Generator creates a native image from a managed
assembly and installs it into the native image cache on the local
computer. The native image cache is a reserved area of the global
assembly cache. Once you create a native image for an assembly, the
runtime automatically uses that native image each time it runs the
assembly. You do not have to perform any additional procedures to
cause the runtime to use a native image. Running Ngen.exe on an
assembly allows the assembly to load and execute faster, because it
restores code and data structures from the native image cache rather
than generating them dynamically.

Regards - OHM# (e-mail address removed)
 
* "TM said:
I have a small application that displays records from an access mdb into two
datagrids and am looking to see if it is possible to speedup the loadtime
somehow.

In my formload I am filling my dataset and binding it to the datagrids. Is
there a better place to get my grids loaded and speed up the program
loadtime ?

Post some code...
 
Ok, here is the code I am using to load my grids. I have two datagrids.
code to load the first grid
--------------------------------------
'clear dataset
objMasterListDataSet.Clear()
objMasterListDA.FillSchema(objMasterListDataSet, SchemaType.Source,
"MasterList")
'fill dataset with info from dataAdapter
objMasterListDA.Fill(objMasterListDataSet, "MasterList")
'removed when deleted true dbgrid
'tdbgMasterItems.DataSource = objMasterListDataSet
'tdbgMasterItems.DataMember = "MasterList"
grdMasterItems.DataSource = objMasterListDataSet
grdMasterItems.DataMember = "MasterList"
' Create new Table Style.
Dim ts As New DataGridTableStyle
ts.MappingName = "MasterList"
grdMasterItems.TableStyles.Clear()
grdMasterItems.TableStyles.Add(ts)
' Assign New Width to DataGrid column.
grdMasterItems.TableStyles("MasterList").GridColumnStyles("Isle").Width = 50
grdMasterItems.TableStyles("MasterList").GridColumnStyles("Item").Width =
160
grdMasterItems.TableStyles("MasterList").GridColumnStyles("Isle").NullText =
"00"
grdMasterItems.TableStyles("MasterList").GridColumnStyles("Item").NullText =
" "
'set master list grid label to total number of records
updateMasterLabel()

code to load the second grid
-------------------------------------------
'clear dataset
objShoppingListDataSet.Clear()
objShoppingListDA.FillSchema(objShoppingListDataSet, SchemaType.Source,
"ShoppingList")
'fill dataset with info from dataAdapter
objShoppingListDA.Fill(objShoppingListDataSet, "ShoppingList")
grdShoppingList.DataSource = objShoppingListDataSet
grdShoppingList.DataMember = "ShoppingList"
' Create new Table Style.
Dim ts As New DataGridTableStyle
ts.MappingName = "ShoppingList"
grdShoppingList.TableStyles.Clear()
grdShoppingList.TableStyles.Add(ts)
' Assign New Width to DataGrid column.
grdShoppingList.TableStyles("ShoppingList").GridColumnStyles("Isle").Width =
50
grdShoppingList.TableStyles("ShoppingList").GridColumnStyles("Item").Width =
160
grdShoppingList.TableStyles("ShoppingList").GridColumnStyles("Isle").NullTex
t = "00"
grdShoppingList.TableStyles("ShoppingList").GridColumnStyles("Item").NullTex
t = " "
grdShoppingList.TableStyles("ShoppingList").AllowSorting = False
'set shopping list grid label to total number of records
updateShoppingLabel()

I appreciate any help
 
* "TM said:
Ok, here is the code I am using to load my grids. I have two datagrids.
code to load the first grid

Thanks. How many rows are you loading? 100? 1,000? 1,000,000?
 
Back
Top