Showing posts with label exception. Show all posts
Showing posts with label exception. Show all posts

Friday, March 16, 2012

"System.InvalidOperationException: Invalid attempt to MetaData when reader is closed"

I am getting this exception sporadically in a certain block of code (it usually works):

"System.InvalidOperationException: Invalid attempt to MetaData when reader is closed"

The code is below: cmd.CommandText ="[dbo].CountryGetList"; cmd.CommandType = CommandType.StoredProcedure; IDataReader rdr = cmd.ExecuteReader(); List countries =new List(); ...while (rdr.Read()) {//do stuff                  

CountryID = (

Guid)rdr["CountryID"];

//blows up on the next line

cty.Name = (string)rdr["Name"];

}

} rdr.Close();

Any ideas!?

I guess thecmd.Connection has been closed before you finish reading data from IDataReader rdr

Tuesday, March 6, 2012

"OutOfMemory" exception when listing subscriptions in "Report Manager"

Hi There,
We are having a problem in listing subscriptions in Report manager and
getting "OutOfMemory" exception.
Our Application has an event-based subscription management system, and
every-time an event gets fired on the Application-side, it creates an
one-off subscription on the Reporting Services. So overtime the number of
Subscriptions created on the reporting services has grown, and a particular
report has about 8000+ subscriptions to date now.
So when we try to list the subscriptions (for the purpose of management of
subscriptions) in the RS "Report Manager",
for that particular report, System gives an OutOfMemory exception. I think
Report Manager Calls internally
"ListSubscriptions" method (as explained in 840709) and couldn't cope up
with.
And i looked at MSDN Knowledgebase Article:840709, and increased the
"MemoryLimit" setting in RSReportServer.config, but there was no use.
By the way our Server has 2GB of RAM and we use Custom Authentication on
Reporting Services.
Any Suggestions are appreciated.
Regards
Raj ChidipudiI suggest you remove a number of the subscriptions via SQl Server Enterprise
Manager - remove a number of the relevant entries for the report from the
Subscriptions table.
Not tried it myself so I would backup before trying!!
You could also create an rss script to run at the end of day to remove all
subscriptions for a report, somthing like:
Public Sub Main()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim subs As Subscription() = rs.ListSubscriptions(report, "")
If Not subs Is Nothing OrElse subs.Length > 0 Then
For Each subscript As Subscription In subs
rs.DeleteSubscription(subscript.SubscriptionID)
Next
End If
End Sub
Run it using the rs util with:
rs -i scriptname.rss -s http://ServerName/reportserver
Alan
"Raj Chidipudi" wrote:
> Hi There,
> We are having a problem in listing subscriptions in Report manager and
> getting "OutOfMemory" exception.
> Our Application has an event-based subscription management system, and
> every-time an event gets fired on the Application-side, it creates an
> one-off subscription on the Reporting Services. So overtime the number of
> Subscriptions created on the reporting services has grown, and a particular
> report has about 8000+ subscriptions to date now.
> So when we try to list the subscriptions (for the purpose of management of
> subscriptions) in the RS "Report Manager",
> for that particular report, System gives an OutOfMemory exception. I think
> Report Manager Calls internally
> "ListSubscriptions" method (as explained in 840709) and couldn't cope up
> with.
> And i looked at MSDN Knowledgebase Article:840709, and increased the
> "MemoryLimit" setting in RSReportServer.config, but there was no use.
> By the way our Server has 2GB of RAM and we use Custom Authentication on
> Reporting Services.
> Any Suggestions are appreciated.
> Regards
> Raj Chidipudi
>
>|||I think rs.DeleteSubscription("") would be the best bet.
We don't want to really mess with Reporting Services Database directly.
Anyway thanks for the suggestion.
Thanks
Raj Chidipudi
"Alan Byrne" <AlanByrne@.discussions.microsoft.com> wrote in message
news:116EB34B-1BD4-4FDC-ADB8-18BE795D3F22@.microsoft.com...
> I suggest you remove a number of the subscriptions via SQl Server
Enterprise
> Manager - remove a number of the relevant entries for the report from the
> Subscriptions table.
> Not tried it myself so I would backup before trying!!
> You could also create an rss script to run at the end of day to remove all
> subscriptions for a report, somthing like:
> Public Sub Main()
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> Dim subs As Subscription() = rs.ListSubscriptions(report, "")
> If Not subs Is Nothing OrElse subs.Length > 0 Then
> For Each subscript As Subscription In subs
> rs.DeleteSubscription(subscript.SubscriptionID)
> Next
> End If
> End Sub
> Run it using the rs util with:
> rs -i scriptname.rss -s http://ServerName/reportserver
> Alan
>
> "Raj Chidipudi" wrote:
> > Hi There,
> >
> > We are having a problem in listing subscriptions in Report manager and
> > getting "OutOfMemory" exception.
> >
> > Our Application has an event-based subscription management system, and
> > every-time an event gets fired on the Application-side, it creates an
> > one-off subscription on the Reporting Services. So overtime the number
of
> > Subscriptions created on the reporting services has grown, and a
particular
> > report has about 8000+ subscriptions to date now.
> >
> > So when we try to list the subscriptions (for the purpose of management
of
> > subscriptions) in the RS "Report Manager",
> > for that particular report, System gives an OutOfMemory exception. I
think
> > Report Manager Calls internally
> > "ListSubscriptions" method (as explained in 840709) and couldn't cope up
> > with.
> >
> > And i looked at MSDN Knowledgebase Article:840709, and increased the
> > "MemoryLimit" setting in RSReportServer.config, but there was no use.
> > By the way our Server has 2GB of RAM and we use Custom Authentication on
> > Reporting Services.
> >
> > Any Suggestions are appreciated.
> >
> > Regards
> > Raj Chidipudi
> >
> >
> >

Friday, February 24, 2012

"Load report failed"

Everytime after I'm printing a report or exporting one and I try to open the report again I'm getting an exception "Load report failed".
Any ideas why?Just an idea, but have you downloaded all of the hotfixes, and SP's for the version you are using.

GJ|||what is the os that you are using and what is the version of crystal reports?|||i just downloaded the hotfix and it still happens...
i'm using cr 9.0 build-in visual studio 2003
and have an xp pro.

Friday, January 27, 2012

' Question throwing exception

I have a comboBox with some names binded to it....With in the names some of them are like Store's Store, and like Danny's Gym...when i select names with ' in them i get this exception

Incorrect Syntax near 'S' Unclosed Question mark before the charectar string ORDER BY "SomeValue".....how could i go about fixing this?

should i include some king of function that pulls out those quotes? or what? any help with this issue

there are two properties of combobox that can be bound

selected value and the displaymember. you must bound selected value to the pk and use it

instead of the text with the quote problem

going back to the quote problem you might want to check this queries out

USE NORTHWIND
select 'that''s all folks' that's a double single quote

INSERT INTO CUSTOMERS(customerid,companyname, contactname)
values('SOXCL','THE SICK O''CLOCK', 'Jack O''donell')

select * from customers where companyname='THE SICK O''CLOCK'

delete from customers where customerid ='soxcl'

|||

You need to double up quotes in your strings, like changing:

'Danny's'

to

'Danny''s'

This is understood to be a single quote in the string. You should also figure some way to see the string being used for a query like this. If you saw the query:

select column from table where column like 'denny's' it would be obvious what the problem was.