473,772 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change database name for crystal report through VB.net

Ray
Dear all,
Now I am using the report document in vb.net to call the crystal report
and I will set the database information in the report document. The code is
as follow:
...
ReportTemp.Load (_reportname)
For Each table In ReportTemp.Data base.Tables
logoninfo = table.LogOnInfo
With logoninfo.Conne ctionInfo
.ServerName = "Server"
.DatabaseName = "DatabaseA"
.UserID = "abc"
.Password = "abc"
End With
table.ApplyLogO nInfo(logoninfo )
Next table
....

Now, the crystal report is based on the database "DatabaseA" to draw.
However, now, I have two database with the same structure like "DatabaseA"
and "DatabaseB" .
While I want to call the data in "DatabaseB" with the crystal report, I
change the database name as follow in vb.net
...
ReportTemp.Load (_reportname)
For Each table In ReportTemp.Data base.Tables
logoninfo = table.LogOnInfo
With logoninfo.Conne ctionInfo
.ServerName = "Server"
.DatabaseName = "DatabaseB"
.UserID = "abc"
.Password = "abc"
End With
table.ApplyLogO nInfo(logoninfo )
Next table
....

However, finally, the report come out call the data in DatabaseA and not
DatabaseB.

Please help. Or should I create the report for different database even for
same report same structure?
Thanks a lot,
Ray
Nov 21 '05 #1
0 1872

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1130
by: Grant Stanley | last post by:
I'm developing an application in VS.Net 2003 using C#, which uses Crystal Reports. When creating each report, crystal asks where the database to use is, so I specify our SQL server using the ADO option. The problem is that these database settings seem to get compiled into the report, so when we take the application to our client it won't work on their systems. Before running each report I run some code which is ment to reset the...
4
8208
by: Sam Fisher | last post by:
Hi, I have a crystal reports hosted on the IIS as web service. Everything works fine except that I can not access the database other than the one on which the report originally created. I am using the LogOnInfo of the viewer to set the user name, password, database location and server names But the following kb article says 'When using the viewer's LogOnInfo collection, you are unable to change the database/table information for a report...
7
34789
by: TJoker .NET | last post by:
I'm developing an VB.NET Windows Forms application that uses CR for VS.NET (original version shipped with VS.NET 2002 - my VS.NET has the latest SP installed, no SPs for CR). My reports get their data from ADO.NET Datasets that are pre-populated by other modules of the application. What I need to do is to use these datasets as the datasources of my reports. Fine, I know how to do that and it works perfectly on my development box. The...
3
11013
by: route_coder | last post by:
I am using access database to create a crystal report in VB.NET Everything works fine when I run on my machine. But when I am deploying it other windows machines. It is asking for database server name and logon information. The problem which I understood from this is that the path is hardcoded in the crystal report and the database is in my bin folder. when I run my app on other machines it is looking for the database in that folder and...
7
11250
by: Henry | last post by:
I am writing a Windows forms VB.Net/MS SQL application via VS 2003 that utilizes Crystal Reports. I want to be able to dynamically set the report data source at run time. I'm trying to change the the reports "integrated security" from TRUE to FALSE via the "Set Location" dialog in the report designer with no success. It is not intuitive (at least not to me.) I get the following error:
2
1709
by: Jasper Jones | last post by:
Hi, I've designed several Crystal Reports using the built in wizard. They point to my database as HQ which is called "Thom". There is a database called Sales on Thom which all the reports point to and get their results from. I'm ready to compile my program to give to the users at a different site. They have a database server there called "Sidney" which had a copy of the same "Sales" database on there. Is there a way I can change the...
6
9473
by: Agnes | last post by:
Please help, i had completed over 30-50 reports, now. our client insist to change the database name. anyshorcut that I can change the database name in the report without re-write all of them ?? Thanks in advance
0
1058
by: hemu4hemang | last post by:
Hi Friends I m working on one application in Vb.net and Sql server and crystal report 9.0. This application works fine and all reports are open successfully. I assign servername and database name at runtime in my code while opening reports. But whenever i change my server some reports are not open. If i open these reports manually from crystal report and update servername and database name...
7
10113
OuTCasT
by: OuTCasT | last post by:
I know how to change the database and sqlserver for a crystal report Dim report As New ReportDocument Dim connection As IConnectionInfo Dim oldServerName As String = ".\SQLEXPRESS" Dim oldDatabaseName As String = oldDatabaseName Dim newServerName As String = newServerName Dim newDatabaseName As String = newDatabaseName Dim UserID As String = "" Dim Password As String = ""
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.