这是我的代码,是菜鸟,刚上这论坛,请大家多多指教,还不知怎样得分,发分,望解答
下面是我的代码
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();
    }
}