Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
"Logon failed. Details: [Database Vendor Code: -2147217887 ] Failed to export the report. Error in File RptQuotationSlip {825EDEC6-A451-4ED8-AD47-BF09268A547F}.rpt: Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: -2147217887 ]"

When I click on generate report button in my application generating crystal report. The report is generating in local host(working fine) but when same application copied to development server system unable to generate report. I got the error message as I mention above in bold letters.

Please help me on this problem.


Advance Thank You.


Here is my code :

C#
strPath = "../Reports/RptQuotationSlip.rpt";
            rptDoc = new ReportDocument();
            rptDoc.Load(Server.MapPath(strPath));

            string strServerName = ConfigurationManager.AppSettings["RptServerName"].ToString();
            string strDatabaseName = ConfigurationManager.AppSettings["RptDBName"].ToString();
            string strPassword = ConfigurationManager.AppSettings["RptPassword"].ToString();
            string strUserID = ConfigurationManager.AppSettings["RptUserID"].ToString();
            rptDoc.SetDatabaseLogon(strUserID, strPassword, strServerName, strDatabaseName);

            rptDoc.SetParameterValue("@1_QuoNo", QuoteID);
            rptDoc.SetParameterValue("@1_AgentName", strAgentName);
            rptDoc.SetParameterValue("@1_AgentTelNo", strAgentTelNo);
            rptDoc.SetParameterValue("@1_QuoNo", QuoteID, "RptNCDValues");
            rptDoc.SetParameterValue("@1_QuoNo", QuoteID, "RptExtraCoverageDtls");
            rptDoc.SetParameterValue("@1_QuoNo", QuoteID, "RptExtraCoverNote");

            objStr = (System.IO.MemoryStream)rptDoc.ExportToStream(ExportFormatType.PortableDocFormat);//I am getting error here.

            Response.Clear();
            Response.Buffer = true;
            Response.ContentType = "application/pdf";
            Response.BinaryWrite(objStr.ToArray());
            rptDoc.Refresh();
            Response.Flush();
            Response.Close();
Posted
Updated 10-Jul-13 1:15am
v3
Comments
walterhevedeich 10-Jul-13 7:10am    
Are you pointing to the same database when you moved the report to the development server? It does not seem to be a code but a login issue.
NAGARAJ N MACHAKNUR 10-Jul-13 7:18am    
Its referring to same data base.
walterhevedeich 10-Jul-13 7:32am    
Are you using the same credentials in logging in to the database?
NAGARAJ N MACHAKNUR 10-Jul-13 7:48am    
Ya same credentials. Its working fine when I test in my local host but in development server its not working.
ZurdoDev 10-Jul-13 7:52am    
The error is pretty clear.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900