Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 22nd, 2005, 09:22 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invalid attempt to FieldCount when reader is close

I am using VS 2005 and created crystal report file abc.rpt and when I choose preview it shows the content correctly (The report was created using calling stored procedure which had 2 params). When I inserted this abc.rpt to one of my asp.net form, I get the following error message after through with Page_Load().

Stack Trace:


[InvalidOperationException: Invalid attempt to FieldCount when reader is closed.]
   System.Data.SqlClient.SqlDataReader.get_FieldCount () +62
   System.Data.Common.DbEnumerator.BuildSchemaInfo() +76
   System.Data.Common.DbEnumerator.MoveNext() +35
   System.Web.UI.WebControls.ListControl.PerformDataB inding(IEnumerable dataSource) +688
   System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e) +81
   System.Web.UI.WebControls.ListControl.PerformSelec t() +32
   System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +99
   CrystalDecisions.Web.CrystalReportSource.GetContro lParameterValue(ControlParameter parameter) +332
   CrystalDecisions.Web.CrystalReportSource.GetParame terValue(Parameter parameter) +140
   CrystalDecisions.Web.CrystalReportSource.BindContr olParameter(Parameter parameter) +513
   CrystalDecisions.Web.CrystalReportSource.DataBindP arameters() +191
   CrystalDecisions.Web.CrystalReportSource.EnsurePar ameters(Boolean forceDataBind) +90
   CrystalDecisions.Web.CrystalReportSource.LoadCompl eteEventHandler(Object sender, EventArgs e) +47
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +96
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4085

Can anybody tell me how to fix this problem?
Thank you.


Reply With Quote
  #2 (permalink)  
Old December 28th, 2005, 01:18 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem was solved when I set the parameters from the code instead from the UI's property for Parameters. In another word, instead of using Parameter Colelction Editor fomr MS VS 2005, I entered the following lines instead;
crDailySource.ReportDocument.SetParameterValue("@m ilestones", ddlMilestones.SelectedItem.Text);
crDailySource.ReportDocument.SetParameterValue("@r elease", ddlRelease.SelectedItem.Text);
Now, it's working like charm :D

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser close when screen saver close Rehanrana Pro VB 6 1 April 7th, 2008 03:09 AM
user function attempt demac43 Excel VBA 3 November 8th, 2006 05:59 PM
Invalid attempt to Read when reader is closed. nidy_online VS.NET 2002/2003 0 April 28th, 2004 11:02 AM
Invalid attempt to Read when reader is closed. nidy_online VS.NET 2002/2003 1 April 28th, 2004 02:19 AM



All times are GMT -4. The time now is 05:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.