This is my error !!
Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\EMWORK~1\ASPNET\LOCALS~1\Temp\CrystalReport {E313040D-019A-49CE-A3E4-EACD36CB486B}.rpt: Unable to connect: incorrect log on parameters.
I create crystal report using DataSet and use tools in VS 2005 such as CrystalReportViewer and CrystalReportSorce. but it not to load Data to show me. I hope maybe someone can help me. Thank you .
This is my sample code in Report.aspx
using System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
System.Data.SqlClient;
using
CrystalDecisions.CrystalReports.Engine;
public
partial class Report : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string dsn = ConfigurationManager.ConnectionStrings ["NorthwindConnectionString"].ConnectionString;
SqlConnection cn = new SqlConnection(dsn);
string selectCmd = @"SELECT CategoryID, CategoryName, Description, Picture FROM Categories";
SqlDataAdapter da = new SqlDataAdapter(selectCmd, cn);
DataSet ds = new DataSet("Rpt");
da.Fill(ds,
"Table1");
ReportDocument
myReportDocument = new ReportDocument();
myReportDocument.Load(Server.MapPath(
@"CrystalReport.rpt"));
myReportDocument.SetDataSource(ds);
CrystalReportViewer1.ReportSource = myReportDocument;
//CrystalReportViewer1.DataBind();
CrystalReportViewer1.DisplayToolbar =
false;
}
}
=================================================Thks.