?
Solved

Shared data source details within a reporting services custom code function

Posted on 2007-03-22
7
Medium Priority
?
945 Views
Last Modified: 2008-01-09
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?...
0
Comment
Question by:PFrog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 11

Expert Comment

by:Ved Prakash Agrawal
ID: 18770074
http://www.code-magazine.com/article.aspx?quickid=0701061&page=2

please just check it out this site may be help full for you.
0
 
LVL 18

Author Comment

by:PFrog
ID: 18770103
Thanks ved17nov, but that shows how to get what I already have - a static, hard coded connection string.

I'm trying to make the code dynamically set its own connection string to be the same as the shared data source.
0
 
LVL 18

Author Comment

by:PFrog
ID: 18770104
I have to say, I don't think it is possible - however with the combined genius of all our experts I'm hoping someone will come up with something!
0
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
LVL 18

Expert Comment

by:chrismc
ID: 18770195
I can't help you outright. But if there is a way to hook into the reports security/connection try trawling through the Microsoft.ReportingServices namespace, I would expect an object or method in there to allow you to do it - after all it's what Reporting Services itself is going to be using.

Cheers
Chris
0
 
LVL 18

Accepted Solution

by:
PFrog earned 0 total points
ID: 18791515
Thanks chrismc - I've had a long play with this and can't get the details out - although I certainly don't claim to be a .Net expert! A microsoft guy on their forums has also said it isn't possible - oh well, maybe it will be available in future releases.

I've resorted to storing a connection string in the database (pointing to itself!), querying it as a parameter of the report, then passing it in as a parameter to the custom code function.

Not that pretty, but at least it saves having to add a registry entry to each client machine.

Thanks anyway

Mods - can you please close the question?
0
 
LVL 18

Expert Comment

by:chrismc
ID: 18791524
No probs.

Cheers
Chris
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how the fundamental information of how to create a table.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question