Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Problem in bindinf crystal report with dataset in asp.net c#

$
0
0

Dear All,

I am new to Crystal report . I am finding a problem in Crystal report. it gives me an error when i try to bind crystal report with "Dataset" .

if anyone knows please help its urgent .

protected void Button1_Click(object sender, EventArgs e)
    {
        ReportDocument rpt = new ReportDocument();
        rpt.Load(Server.MapPath("BilllReport.rpt"));
        DataSet ds = new DataSet();
        SqlConnection con = new SqlConnection("Data Source=MO02\\SQLEXPRESS;Initial Catalog=TestDatabase;Integrated Security=True");
        SqlCommand cmd = new SqlCommand("select * from empdetails", con);
        con.Open();
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        adp.Fill(ds);
        rpt.SetDataSource(ds);
        CrystalReportViewer1.ReportSource = rpt;
        CrystalReportViewer1.DataBind();
        con.Close();
    }




Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>