日期:2014-05-17  浏览次数:20978 次

push缺少字段


这是我的代码,是菜鸟,刚上这论坛,请大家多多指教,还不知怎样得分,发分,望解答
下面是我的代码
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page 
{
  protected void Page_Load(object sender, EventArgs e)
  {
  string sql = "select PersonName,Birthday,DeptName from Sys_Person, Sys_Dept where Sys_Person.DeptID= Sys_Dept.DeptID";
  string DBconfig_sql = @"data source=pc00693;initial catalog=xuewei;user id=sa;password=P@ssw0rd";
  DataSet da = new DataSet();
   
  SqlConnection sqlcon = new SqlConnection(DBconfig_sql);
  SqlCommand cmd = new SqlCommand(sql,sqlcon);
  SqlDataAdapter aq = new SqlDataAdapter();
  aq.SelectCommand = cmd;
  aq.Fill(da,"sql");
   

   
  CrystalReportSource1.ReportDocument.Load(Server.MapPath("CrystalReport1.rpt"));
  CrystalReportSource1.ReportDocument.SetDataSource(da.Tables["sql"]);
  CrystalReportSource1.DataBind();
  CrystalReportViewer1.ReportSource = CrystalReportSource1;
  CrystalReportViewer1.DataBind();
  }
}

------解决方案--------------------
看不到图。
是不是CrystalReport1.rpt中用到什么字段在sql中没有返回.