Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

my code file is given below....

C++
protected void Page_Load(object sender, EventArgs e)
   {
       ConnectionInfo con = new ConnectionInfo();
       con.ServerName = "HHDVAQUAS";
       con.DatabaseName = "Current";
       con.UserID = "sa";
       con.Password = "samesame";

       CrystalReportViewer1.ParameterFieldInfo.Clear();
       CrystalReportViewer1.ReportSource = Server.MapPath("Report/RptGpsCustomerList.rpt");
       ParameterFields parameter = CrystalReportViewer1.ParameterFieldInfo;
       ParameterField strid = new ParameterField();
       strid.Name = "@strIDs";
       ParameterDiscreteValue par_custid_value = new ParameterDiscreteValue();
       par_custid_value.Value = Session["stID"].ToString();
       strid.CurrentValues.Add(par_custid_value);
       parameter.Add(strid);
       ParameterField intFilterType = new ParameterField();
       intFilterType.Name = "@intFilterType";
       ParameterDiscreteValue par_intFilterType_value = new ParameterDiscreteValue();
       par_intFilterType_value.Value = Convert.ToInt16(Session["ReportBy"].ToString());
       intFilterType.CurrentValues.Add(par_intFilterType_value);
       parameter.Add(intFilterType);
       foreach (TableLogOnInfo tlf in CrystalReportViewer1.LogOnInfo)
       {
           tlf.ConnectionInfo = con;
       }


The above code is working ..but every time i have to change connection Information in this code when i deploy my page on other m/c.
i want to provide the connection by my web.config file.

please help me
Posted

1 solution

This Link Web.Config Connection String Settings[^] May help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900