Skip to Content
0

Please i need to solve this Error in Crystal Reports

Feb 12 at 07:38 AM

39

avatar image
Former Member

The error I am getting in C# using SQL Server Express and Visual Studio 2010:

Failed to load database information. Error in File temp_a5038319-c88d-44d7-848b-70813999b829 {1DD999F6-282A-4783-9D53-184BC0A4E344}.rpt: Failed to load database information. The error occurred at rpt.SetDataSource(ds).

I have a dataset for reporting.

Here is the code:

private void button1_Click(object sender, EventArgs e)

{

try

{

con = new SqlConnection(cs.DBconn2);

con.Open();

cmd = new SqlCommand("SELECT * FROM Student WHERE AdmissionNo = 56777", con);

adp = new SqlDataAdapter(cmd);

DataTable table = new DataTable();

ds = new DataSet();

adp.Fill(table);

con.Close();

ds.Tables.Add(table);

ds.WriteXmlSchema("Student.xml");

CrystalReport1 rpt = new CrystalReport1();

if (ds.Tables[0].Rows.Count == 0)

{

MessageBox.Show("No data Found");

return;

}

rpt.SetDataSource(ds);

frm.crystalReportViewer1.ReportSource = rpt;

frm.ShowDialog();

}

catch (Exception ex)

{

MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Don Williams
Feb 14 at 10:18 PM
0

What SDK are you using?

Only Supported .NET SDK now is from here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

The WIKI has a test app with Parameter in the name which you can use to test also.

Don

Share
10 |10000 characters needed characters left characters exceeded