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
ronipatsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dengiaCommented:
Hi,
where do you set connection string for crystal report? The exception you get is expected as you use Win authentication and it works fine on your machine but on client server you have to provide username and password in connection string. So please, write me where do you set connection string for your crystal report?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dengiaCommented:
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);
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.