Hello ,
Try this
CrystalReport cr = new CrystalReport();
--call the crystall report
DataSet ds1 = new DataSet();
SqlConnection myCon;
SqlDataAdapter myAdapter;
myCon = new SqlConnection("Data Source=.;Initial Catalog=dbs;
Persist Security Info=True;");
SqlCommand cmd = new SqlCommand("select * from tbl", myCon);
myAdapter = new SqlDataAdapter(cmd);
myAdapter.Fill(ds1);
-- Fill the dataset
if (ds1.Tables[0].Rows.Count > 0)
{
cr.SetDataSource(ds1.Tables[0]);
--here set the crytal report DataSource to DataTable
crystalReportViewer1.ReportSource = cr;
crystalReportViewer1.Refresh();
}
thanks