Saturday, February 25, 2012

Access shared data source inside custom assembly

I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.

How do I accomplish this?

I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.

Check Jason's blog here

http://weblogs.asp.net/jgaylord/archive/2005/05/12/406639.aspx

HTH
Regards

|||

Thank you. I read that blog, but it just seems to mention connection strings in general. The issue I am facing is that the Reporting Services assembly does not seem to allow me to access web.config, even though there is a web.config associated with RS. When I try to write "Imports System.Web.Configuration," VS2005 says it is not available and that the WebConfigurationManager is not available.

|||

Ok, simply add the System.Configurations.Dll as a reference in your project.

Let me know if you need further help.

Regards

No comments:

Post a Comment