If you are Talking about Crystal Reports:
u have to use the references CrystalDecisions.*
and in button click
Reports.ReportName report=new Reports.ReportName();
report.setDatabaseLogon("Database UserName","Database Password");
report.setParameterValue("ParameterName",ParameterValue);
CrystalReportViewer1.ReportSource = report;