Crystal Report Error: Database Logon failed in ASP.Net

Last Reply 8 months ago By dharmendr

Posted 8 months ago

I don't know why crystal report is not shown in browser?

I got error: database logon failed massage

using System.Web.UI.WebControls; //Crystal Report Namespaces 
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

namespace CRTest
    public partial class Default : System.Web.UI.Page
        CrystalReportTest rpt;
        protected void Page_Load(object sender, EventArgs e)

        protected void Page_Init(object sender, EventArgs e)

            if (Session["report"] != null)
                CrystalReportViewer1.ReportSource = (CrystalReportTest)Session["report"];

        protected void Button1_Click(object sender, EventArgs e)
        {//looks 2 part CRDataset and ApplicantInfoKTableAdapter in CRDataset.xsd

            //namespace CRTest.CRDataSetTableAdapters +public partial class ApplicantInfoKTableAdapter
            CRDataSetTableAdapters.ApplicantInfoKTableAdapter da = new CRDataSetTableAdapters.ApplicantInfoKTableAdapter();
            CRDataSet ds = new CRDataSet();
            //database+table name
            CRDataSet.ApplicantInfoKDataTable dt = (CRDataSet.ApplicantInfoKDataTable)
            rpt = new CrystalReportTest();
            CrystalReportViewer1.ReportSource = rpt;
            Session.Add("report", rpt);

Posted 8 months ago

Hi KatieNgoc,

Looks like it is Database Login issue.

Make sure that the Server Name, Database Name, UserName and Password is correct.