Link to home
Start Free TrialLog in
Avatar of ronipats
ronipats

asked on

asp.net crystal report problem

Sir,

I have developed one web application using asp.net(C#), sql server 2008, crystal report with framework support of 3.5.

on my development machine, i am using windows authentication for connectivity with sql server. on client server it is sqlserver authentication which requires username and password.

I have designed and crystal report and it works fine on my development machine.

Now i am uploading that application on my client's web server. I am publishing  application then uploading the same on clients server.

As soon as i try to access the report from clients server i am getting following error

Error
Failed to open the connection. Details: [Database Vendor Code: 17 ] Failed to open the connection. temp_319fee1a-1b9d-4cc7-b8ac-8ca714225296 {FB8D324C-CE32-48E3-A79C-60EC8EDC716F}.rpt Details: [Database Vendor Code: 17 ]

how to resolve this error
ASKER CERTIFIED SOLUTION
Avatar of dengia
dengia

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dengia
dengia

I guess you have your connection string in app.config, so you can use this approach - code it just before you actually open the report:

ReportDocument yourReport = this.CrystalReportSource1.ReportDocument;
 
 yourReport.DataSourceConnections[0].LogonProperties.Set("Connection String",
 ConfigurationManager.AppSettings["keyForYourConnStringInAppConfigFile"]);
 
 CrystalDecisions.Shared.NameValuePairs2 yourLogon = new CrystalDecisions.Shared.NameValuePairs2();
 yourLogon.AddRange(doc.DataSourceConnections[0].LogonProperties);
 
 yourReport.DataSourceConnections[0].SetLogonProperties(yourLogon);