I'm successfully querying my database from within a custom code function within an SSRS 2005 report.
My problem is that I'm hard coding the connection string within the function (System.Data.SqlClient.SqlConnection) - I need to be able to use the same connection as the shared data source that the report uses. I could grab the details from a registry setting or some other work around, but for tidyness and simplicity I really want to get the code to seemlessly talk to the same database.
I either need to pass in the connection details as a parameter to the function, or get the details from within the function - either would be fine.
Anyone got any ideas?...