In windows application
1- define ParameterDiscreteValue object
2- set the value for that object
3- add this object to CurrentValues of the CrystalReport ParameterFields
here is an example
DetailedCustomerOrderReport aReport = new DetailedCustomerOrderReport(); // your crystalReport
ParameterDiscreteValue paramDV_UserId = new ParameterDiscreteValue(); // Step 1
paramDV_UserId.Value = userid; // step 2:userid is the value for the parameters
aReport.ParameterFields["@UserId"].CurrentValues.Add(paramDV_UserId); // step 3: @UserId is the parameter you add at the design of crystal report
--------------------------------------------
In web application
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath(@"~/reports/rptCustomerRecords.rpt"));
report.FileName = Server.MapPath(@"~/reports/rptCustomerRecords.rpt");
report.SetParameterValue("@Userid", userid);
// @UserId is the parameter you added at the design of the crystalReport
and userid is the value for the parameters
CrystalReportViewer1.ReportSource = report;
I hope it help you