Dear all,
Now that I'm able to use and publish my projects properly, I'm facing a "Failed to load connection" on my first report, on my production machine.
I'm using on my development machine SQL Server Express, and getting connected via an ODBC connection for my Web .NET project. This works fine, but on my production machine, although I have created the same ODBC connection (same name, same sql instance) the error "Failed to load Connection" is raised.
"GabillySAS" is the name of the ODBC connection. I've used the Help file provided for Crystal Report 2008 with Visual Studio 2008, so the code is :
private void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}
private void ConfigureCrystalReports()
{
CrystalReportViewer1.ReportSource = Server.MapPath("\\content\\heures\\rapports\\"+Request.QueryString["id"]);
ConnectionInfo connectionInfo = new ConnectionInfo();
SetDBLogonForReport(connectionInfo);
connectionInfo.DatabaseName = "GabillySAS";
connectionInfo.UserID = "----";
connectionInfo.Password = "-----";
}
private void SetDBLogonForReport(ConnectionInfo connectionInfo)
{
TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo logOnInfo in tableLogOnInfos)
{
logOnInfo.ConnectionInfo = connectionInfo;
}
}