Vs2005 中水晶报表:无论用那种模式,都连不上,不知那有错?
cs文件:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using System.Data.SqlClient;
public partial class ks1_Default4 : System.Web.UI.Page
{
//    protected void Page_Load(object sender, EventArgs e)
//    {
       
//    }
//    //    protected void Button_pull_Click1(object sender, EventArgs e)
//   {
//        CrystalReportSource1.ReportDocument.Load(Server.MapPath("CrystalReport.rpt"));
//        CrystalReportSource1.ReportDocument.SetDatabaseLogon("ch", "888", Q"server3", "anjz");
//       // CrystalReportSource1.ReportDocument.SetParameterValue("Parm", "1");//        CrystalReportSource1.DataBind();
////        CrystalReportViewer1.ReportSource = CrystalReportSource1;
//        CrystalReportViewer1.DataBind();
//    } 
       protected void Button_push_Click1(object sender, EventArgs e)
    {
        string sql = "Select jftz.* FROM jftz";
        string DBConfig_sql = @"Data Source=server3;Initial Catalog=anjz;Integrated Security=True";
        DataSet ds = new DataSet();
            SqlConnection sqlCon = new SqlConnection(DBConfig_sql);
            SqlCommand sqlCmd = new SqlCommand(sql, sqlCon);
            SqlDataAdapter sqlAd = new SqlDataAdapter();
            sqlAd.SelectCommand = sqlCmd;
            sqlAd.Fill(ds, "sql");
        CrystalReportSource1.ReportDocument.Load(Server.MapPath("CrystalReport.rpt"));   
                CrystalReportSource1.ReportDocument.SetDataSource(ds.Tables["sql"]);
               ["Parm"].CurrentValues.AddValue("1234567");
         CrystalReportSource1.DataBind();
 
        CrystalReportViewer1.ReportSource = CrystalReportSource1;
        CrystalReportViewer1.DataBind();
    }
}在水晶报表的数据库专家中怎么也连不上去,不知何故?二种方式都试了。报表出来了,就是没数据。