Click here to Skip to main content
15,890,717 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I host my web asp web site two different server.Same configuration this two server.server No 1 crystal report data view Properly.Server No2 only view report viwer and Static field now display data column.

Seerver No 1 connection string,
SqlConnection conStr = new SqlConnection("Data Source=TESTSERVER\\SQL_08R2;Initial Catalog=ERP_DB;User ID=sa;Password=h@123;pooling=false");
            SqlCommand cmd = new SqlCommand(" Select * from  tblPrintCOdAdvice", conStr);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            adp.Fill(ds, "TblCOD");
            ReportDocument BooksReport = new ReportDocument();
            BooksReport.Load(Server.MapPath("DCREPORT.rpt"));
            BooksReport.SetDataSource(ds.Tables["TblCOD"]);
            CrystalReportViewer1.ReportSource = BooksReport;
            CrystalReportViewer1.DataBind();
  

Server No 2 connection string,
SqlConnection conStr = new SqlConnection("Server=WIN-QBTC29S7939;User ID=sa;Password=h@123;Database=ERP_DB;");
            SqlCommand cmd = new SqlCommand("Select * from tblPrintCOdAdvice", conStr);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            adp.Fill(ds, "TblCOD");
            ReportDocument BooksReport = new ReportDocument();
            BooksReport.Load(Server.MapPath("DCREPORT.rpt"));
            BooksReport.SetDataSource(ds.Tables["TblCOD"]);
            CrystalReportViewer1.ReportSource = BooksReport;
            CrystalReportViewer1.DataBind();


How Solve this Problem.


Thank You.
Posted
Comments
Suvendu Shekhar Giri 26-Mar-15 0:46am    
Don't share credentilas in question. Please format your question content. Question is not clear so, try improving your question so that someone can help you.
Krishna Rpr 26-Mar-15 1:07am    
I thing server.mappath is problem. Please give me the correct location
[no name] 26-Mar-15 1:25am    
you mean this path,
C:\inetpub\wwwroot\Antron
OR
<add name="AntronERP_DBConnectionString" connectionstring="Data Source=WIN-QBTC29S7939;Initial Catalog=ERP_DB;User ID=sa;Password=h@123" providername="System.Data.SqlClient">

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

  Print Answers RSS


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