Wrox Programmer Forums
|
BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Special Edition by Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muhammad, Srinivasa Sivakumar; ISBN: 9780470041789
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2014, 05:33 AM
Registered User
 
Join Date: Sep 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Issue resolved

The below solution works for me. Let me know if anyone encounters any issue with the stated solution.

SqlCommand cmd = new SqlCommand();
protected void Page_Load(object sender, EventArgs e)
{
IAsyncResult result;
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrin gs["MyConn"].ConnectionString);
cmd.CommandText = "Select Top 3 * from [Customers]";
cmd.CommandType = CommandType.Text;
cmd.Connection = conn;
cmd.Connection.Open();
result = cmd.BeginExecuteReader(new AsyncCallback(CBMethod), CommandBehavior.CloseConnection);
System.Threading.Thread.Sleep(5000);
}

public void CBMethod(IAsyncResult result)
{
SqlDataReader dr;
dr = cmd.EndExecuteReader(result);
GV1.DataSource = dr;
GV1.DataBind();
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
DataReader error on Listing 12-19 cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 January 3rd, 2008 12:36 PM
Listing 12-1 cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 3 August 16th, 2007 01:00 PM
Listing 12 - 8 "Mars" Asp.Net BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 March 5th, 2007 07:33 AM
Listing 12-1 topm BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 March 3rd, 2006 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.