Tuesday, February 15, 2011

crystal report data bind

SqlConnection con = new SqlConnection("database=.;initial catalog=navodya_vidyalya; integrated security=true;");

SqlDataAdapter adap = new SqlDataAdapter("select id,value from query", con);

DataSet ds = new DataSet();

adap.Fill(ds);

CrystalReport1 ob = new CrystalReport1();

ob.SetDataSource(ds.Tables[0]);

ob.SetParameterValue("manu", textBox1.Text);

crystalReportViewer1.ReportSource = ob;

No comments :

Post a Comment