Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

Tuesday, March 27, 2012

Datasource information retrieved from a database

Hi everyone,
I have an assembly deployed on my report server that contains a number of
functions used by my reports. The assembly has full trust and all of the
functions work fine except one.
The purpose of this function is to query a database table for the correct
connection string for the report datasource. The code that returns the
connection string works correctly in a test windows app. When I run the
report through report manager, I get the following error:
Does this mean that a report server can only use the database where it
stores its server information? This would be inconvenient and I would like
to avoid it if possible.
Also, I would prefer my assembly not to have full trust, and instead only
have the permissions necessary to allow it to read from the database where
the connection string information is stored. So far, I have found plenty of
sample code describing the XML that I need to add to grant
FileIOPermissions, but nothing on database-related permissions. Can anyone
point me in the right direction?
Thanks in advance,
Ed AllisonFor anyone else who gets stuck on this, the solution is here:
http://blogs.sqlxml.org/bryantlikes/archive/2004/07/21/845.aspx
"Ed Allison" <ed@.optix.co.uk> wrote in message
news:eMGQtxzUGHA.5996@.TK2MSFTNGP10.phx.gbl...
> Hi everyone,
> I have an assembly deployed on my report server that contains a number of
> functions used by my reports. The assembly has full trust and all of the
> functions work fine except one.
> The purpose of this function is to query a database table for the correct
> connection string for the report datasource. The code that returns the
> connection string works correctly in a test windows app. When I run the
> report through report manager, I get the following error:
> Does this mean that a report server can only use the database where it
> stores its server information? This would be inconvenient and I would
> like to avoid it if possible.
> Also, I would prefer my assembly not to have full trust, and instead only
> have the permissions necessary to allow it to read from the database where
> the connection string information is stored. So far, I have found plenty
> of sample code describing the XML that I need to add to grant
> FileIOPermissions, but nothing on database-related permissions. Can
> anyone point me in the right direction?
> Thanks in advance,
> Ed Allison
>

Monday, March 19, 2012

DataRecordTypeToBufferType not declared

When I try to use the DataRecordTypeToBufferType and ConvertBufferDataTypeToFitManaged helper functions in my SIS script it tells me they are not defined. According to the doc they are in the Microsoft.SqlServer.Dts.Pipeline namespace, which I have included and the reference is there. It has been a few years since I have worked with visual studio so I am a little rusty, can anyone tell me what I might be missing?

Thanks!
Harry

Harry,

Do you have both the reference and the using or Imports statement?

Are you trying to invoke a static/Shared method from an instance variable? C# should give you a good error for this, and I think VB allows it.

-Doug
|||Harry,

These are protected methods in the namespace. I don't know why they are documented since they can not be used externally. Can you file a doc bug on this. It won't make RTM but hopefully we can get it into a refresh.

Thanks,
Matt

DataRecordTypeToBufferType not declared

When I try to use the DataRecordTypeToBufferType and ConvertBufferDataTypeToFitManaged helper functions in my SIS script it tells me they are not defined. According to the doc they are in the Microsoft.SqlServer.Dts.Pipeline namespace, which I have included and the reference is there. It has been a few years since I have worked with visual studio so I am a little rusty, can anyone tell me what I might be missing?

Thanks!
Harry

Harry,

Do you have both the reference and the using or Imports statement?

Are you trying to invoke a static/Shared method from an instance variable? C# should give you a good error for this, and I think VB allows it.

-Doug
|||Harry,

These are protected methods in the namespace. I don't know why they are documented since they can not be used externally. Can you file a doc bug on this. It won't make RTM but hopefully we can get it into a refresh.

Thanks,
Matt