CrystalReport2 obj = new CrystalReport2(); SqlConnection con = new SqlConnection(); //This is connection class that return string. ConnectionClass cc = new ConnectionClass(); con.ConnectionString = cc.GetConnection(); con.Open(); //ds = new DataSet(); DataSet2 ds = new DataSet2(); SqlDataAdapter da = new SqlDataAdapter("Select * from Sample", con); SqlCommandBuilder builder = new SqlCommandBuilder(da); da.Fill(ds, "Sample"); obj.SetDataSource(ds); crystalReportViewer1.ReportSource = obj;
Hai Friend,use this statement to set the datasource obj.SetDataSource(ds.Tables[0]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)