P
Prince
I have a question about the global.asax.cs file. I'm
reading info from a database to populate a DataGrid. I
read somewhere that the opening of the database should
occur in the global.asax.cs file that way every request
doesn't open the database again.
How is this done? It doesn't seem that the global file
can access the DataGrid webcontrol, located on the
index.aspx, file. Only the index.aspx.cs file can access
this control.
Also, I tried putting the connection object inside the
global.asax.cs file but could not reference it in the
index.aspx.cs file.
What is the best practice for populating a DataGrid from
a database table? I would think I could open the
database, populate the DataGrid and close the connection
all within the global.asax.cs file's Application_Start()
event handler. Then within the index.aspx.cs file, just
re-bind the control.
Does someone please give me an example of how this is
done?
thanks,
Prince
reading info from a database to populate a DataGrid. I
read somewhere that the opening of the database should
occur in the global.asax.cs file that way every request
doesn't open the database again.
How is this done? It doesn't seem that the global file
can access the DataGrid webcontrol, located on the
index.aspx, file. Only the index.aspx.cs file can access
this control.
Also, I tried putting the connection object inside the
global.asax.cs file but could not reference it in the
index.aspx.cs file.
What is the best practice for populating a DataGrid from
a database table? I would think I could open the
database, populate the DataGrid and close the connection
all within the global.asax.cs file's Application_Start()
event handler. Then within the index.aspx.cs file, just
re-bind the control.
Does someone please give me an example of how this is
done?
thanks,
Prince