Skip to Content
0
Former Member
Nov 02, 2012 at 12:33 PM

Failed to load database information. Connection ADO.NET (XML) at runtime.

400 Views

Hello Friends,

Recently I have migrated my web application to new server. It have functioning to download Crystal Reports as PDF file. Everything was working fine on previous server but on current server I am getting "Failed to load database information" error.

Number of columns of my report are not fixed so I am using SDK to add field Objects to Crystal Report. For that,

1) I am creating DataSet (System.Data.Dataset),

2) then I am writing its data to am XML file.

ds.WriteXml(Server.MapPath("sample.xml"), XmlWriteMode.WriteSchema);


3) After that I am creating connectioninfo for that XML file:

Here is my code for connection info:

PropertyBag logonInfo = new PropertyBag();

logonInfo.EnsureCapacity(1);

logonInfo.Add("XML File Path", Server.MapPath("sample.xml"));

PropertyBag attributes = new PropertyBag();

attributes.EnsureCapacity(5);

attributes.Add("Database DLL", "crdb_adoplus.dll");

attributes.Add("QE_DatabaseType", "ADO.NET (XML)");

attributes.Add("QE_ServerDescription", "NewDataSet");

attributes.Add("QE_SQLDB", true);

attributes.Add("QE_LogonProperties", logonInfo);

CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo connectionInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();

connectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;

connectionInfo.Attributes = attributes;

4) Then I am creating table for Crystal Report:

ISCRTable mytable = DataSetConverter.Convert(ds).Tables[0];

mytable.ConnectionInfo = connectionInfo;

reportClientDoc.DatabaseController.AddTable(mytable , null); // this is the line where I am getting error

5) And at the end I am adding fields to my report.

I used a label to print step number so that I can findout where I am getting the error. It is step 4. reportClientDoc.DatabaseController.AddTable(table_columns, null);

Above code is causing problem. Please tell me what can be the issue.

Please help me with this, I will be very thankful to you.

Regards,

Namrata Mathur