473,466 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problems with Crystal

I try to set the connection parameters with the following code,
but the password is not set after a call to ApplyLogOnInfo.
What i am doing wrong ??

The call of TestConnectivity() brings: "Invalid Connection Parameter", but
the values are correct.


// Get the ConnectionInfo Object.
TableLogOnInfo logOnInfo = new TableLogOnInfo();
logOnInfo = m_document.Database.Tables[p_table].LogOnInfo;
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo = logOnInfo.ConnectionInfo;

// Set the Connection parameters.
connectionInfo.DatabaseName = p_database;
connectionInfo.ServerName = p_server;
connectionInfo.Password = p_password;
connectionInfo.UserID = p_user;
m_document.Database.Tables[p_table].ApplyLogOnInfo(logOnInfo);

// Test Connection
Table table = m_document.Database.Tables[p_table];
bool flag = table.TestConnectivity();
Nov 15 '05 #1
1 1813
Hi Roger,

This is the code I'm using to do it:

TableLogOnInfos crTableLogonInfos = new TableLogOnInfos();

ConnectionInfo crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "127.0.0.1";
crConnectionInfo.DatabaseName = "CTP";
crConnectionInfo.UserID = "test";
crConnectionInfo.Password = "test";
foreach (CrystalDecisions.CrystalReports.Engine.Table table in
reportDocument1.Database.Tables)
{
TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();
crTableLogonInfo.TableName = table.Name;
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
crTableLogonInfos.Add( crTableLogonInfo);
table.ApplyLogOnInfo( crTableLogonInfo);

}
CrystalReportViewer1.LogOnInfo = crTableLogonInfos;
AS you see you have to set the connection info for each table in the report.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Roger Boesch" <ro**********@youts.com> wrote in message
news:3f********@news.swissonline.ch...
I try to set the connection parameters with the following code,
but the password is not set after a call to ApplyLogOnInfo.
What i am doing wrong ??

The call of TestConnectivity() brings: "Invalid Connection Parameter", but
the values are correct.


// Get the ConnectionInfo Object.
TableLogOnInfo logOnInfo = new TableLogOnInfo();
logOnInfo = m_document.Database.Tables[p_table].LogOnInfo;
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo = logOnInfo.ConnectionInfo;

// Set the Connection parameters.
connectionInfo.DatabaseName = p_database;
connectionInfo.ServerName = p_server;
connectionInfo.Password = p_password;
connectionInfo.UserID = p_user;
m_document.Database.Tables[p_table].ApplyLogOnInfo(logOnInfo);

// Test Connection
Table table = m_document.Database.Tables[p_table];
bool flag = table.TestConnectivity();

Nov 15 '05 #2

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

Similar topics

1
by: Gudni G. Sigurdsson | last post by:
Hi. I am working on a program for the .NET Framework written in C# with Visual Studio .NET. With this program, one can print a report realized with the Crystal Report software included with VS...
0
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
1
by: Gudni G. Sigurdsson | last post by:
Hi. I am working on a program for the .NET Framework written in C# with Visual Studio .NET. With this program, one can print a report realized with the Crystal Report software included with VS...
1
by: Dreamtime | last post by:
Hi I am using Visual Studio 2005 and the bundled Crystal Reports (previously I used .net 2003 and bundled Crystal Reports for 2 years - same issues!) I have a report which is displayed in the...
0
by: Maru | last post by:
Hi, I have created some programs with visual studio.net (2002) and using crystal report like program in order printing the report, we are then passes to visual studio 2005 and we have realized...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...

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.