Chris Ongsuco's Weblog
Information Technology, business, life, food...

Playing with ExecutePageReader

Tuesday, February 08, 2005 2:25 AM
I've been playing with VS.Net 2005 Beta 1 since December 2004 and here is a sample code snippet:

private void BindControl(int pageIndex)
{

ConnectionStringSettingsCollection cssc = ConfigurationSettings.ConnectionStrings;
string connectionstring = cssc["Main"].ConnectionString;
string sql = "select * from Customers"; // Using Northwind Database

SqlConnection conn = new SqlConnection(connectionstring);
SqlCommand cmd = new SqlCommand(sql, conn);

conn.Open();
SqlDataReader dr = cmd.ExecutePageReader(CommandBehavior.CloseConnection, pageIndex, 5);

gvList.DataSource = dr;
gvList.DataBind();

}

Its a very nice feature but I read in some blogs that Microsoft will not support this feature in their release of Whidbey. Hope its not true.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Feedback

# re: Playing with ExecutePageReader

It's true, it's been marked for removal after Beta

ExecutePageReader(CommandBehavior behavior,Int32 startRecord,Int32 maxRecords)

Message: Do not use, will be removed after beta. 3/19/2005 1:28 PM | Phil Winstanley

Post a comment