here is the code
CrystalReport8 cr3 = new CrystalReport8();
CrystalDecisions.Shared.ParameterFields paramFields = new CrystalDecisions.Shared.ParameterFields();
CrystalDecisions.Shared.ParameterField paramField = new CrystalDecisions.Shared.ParameterField();
CrystalDecisions.Shared.ParameterDiscreteValue paramValue1 = new CrystalDecisions.Shared.ParameterDiscreteValue();
//int number = Int32.Parse(textBox1.Text);
TableLogOnInfo myLogin;
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in cr3.Database.Tables)
{
myLogin = myTable.LogOnInfo;
myLogin.ConnectionInfo.ServerName= "i don't know what i must write here "
myLogin.ConnectionInfo.IntegratedSecurity = true;
myLogin.ConnectionInfo.DatabaseName = "ComputerStock";
myTable.ApplyLogOnInfo(myLogin);
}
paramField.ParameterFieldName = "@salid";
//Setting the first discrete value and passing it to the parameter
paramValue1.Value = Int32.Parse(textBox1.Text);
paramField.CurrentValues.Add(paramValue1);
//Add the parameter fields to the parameter fields collection
paramFields.Add(paramField);
//The second parameter date
//paramField = new CrystalDecisions.Shared.ParameterField();
//paramField.ParameterFieldName = "@ToDate";
//Setting the first discrete value and passing it to the parameter
//Add the parameter fields to the parameter fields collection
paramFields.Add(paramField);
Reports.salerep sr = new salerep();
sr.crystalReportViewer1.ParameterFieldInfo = paramFields;
//sr.crystalReportViewer1.SelectionFormula= "{OutOrders.OutOrderId} = "+Int32.Parse(textBox1.Text)+"";
sr.crystalReportViewer1.ReportSource = cr3;
sr.crystalReportViewer1.Refresh();
sr.Show();
thanks for your care