//绑定按钮代码,winform
string strCon = WaterPlan.Properties.Settings.Default.ConnectionString1.ToString();
DataSet ds = new DataSet(strCon);
string strQuery = "这里填写应该有的sql语句";
SqlDataAdapter sda = new SqlDataAdapter(strQuery, strCon);
sda.Fill(ds, "表名");
CrystalReport1 cr = new CrystalReport1();
cr.SetDataSource(ds);
crystalReportViewer1.ReportSource = cr;