Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Thelma Murray   on Feb 06 In Asp.net Category.

  
Question Answered By: Kristen Chavez   on Feb 06

Off the top of my head , perhaps, at a guess,


void Page_Load(Object Src,EventArgs E) {
string strConn ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
Server.MapPath("dbase3.mdb") + ";";
string strSQL ="select * from Factory1 order by Period";

OleDbConnection Conn = new OleDbConnection(strConn);
OleDbCommand Cmd = new OleDbCommand(strSQL, Conn);
Conn.Open();
OleDbDataReader Rdr;
Rdr=Cmd.ExecuteReader(); ---- 1
MyDataGrid.DataSource = Rdr; ---- 2
MyDataGrid.DataBind();

looking at what we have above, I don't really know ? It executes the reader and then sets the datasource, the true time  would be when the reader is executed to when the datasource is filled (well here its a reader and doesn't actually get filled, but normally its an a adaptor that gets filled).

Perhaps After Execute Reader then start the clock.
Get into the DataBind() function by somehow extending the datagrid, or overridding it or something, and, assuming that the framework will only execute DataBind when there's something to bind to, then stop the timer immediately inside DatBind().

The other alternative is to chuck out a 3 dps random number  between 0 and 0.3 ... who'd know, eh ? half the world makes up their counters anyway, they don't even increment when you refresh.

Share: 

 
 
Didn't find what you were looking for? Find more on Getting the time for the Number of records retrived Or get search suggestion and latest updates.


Tagged: