Print Page | Close Window

.NET with more than one database

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3919
Printed Date: 29 Apr 2024 at 12:41am


Topic: .NET with more than one database
Posted By: toekneel
Subject: .NET with more than one database
Date Posted: 06 Aug 2008 at 3:28pm
I've been deploying Crystal Reports with .NET web applications for over five years now, and this is the first time that I have a group of reports pulling from multiple data sources.  The reports are built and run just fine, but when I attempt to deploy them through the applications, I can't get the logon information passed to the individual tables of the different sources.  I end up passing all of the logon information to the last datasource that is processed.
 
Can anyone pass along a sample of code where more than one datasource is used for a non-embedded report?
 
Thanks!


-------------
toekneel
ABQ, NM



Replies:
Posted By: BrianBischof
Date Posted: 09 Aug 2008 at 4:56pm

I don't know what code you are using to set the login info, but you can loop through the table collection and assign different login credentials to each table. Of course, you would need an If-Then logic to determine which table is currently being evaluated and set the approprieat login credentials based on that.



-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: toekneel
Date Posted: 14 Aug 2008 at 9:16am
Hi Brian-
 
That is essentially what I'm trying to do, but the problem is that I can't figure out a way to indicate which tables are in which database.  What happens is that whatever the last item is that loops through, those credentials are applied to the table, even if it is for the wrong database.
 
Make sense?
 
Thanks!
 
 


-------------
toekneel
ABQ, NM



Print Page | Close Window