本文介绍了关于sql server的水晶报表中的疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void Button1_Click(object sender, EventArgs e)
    {
        string sql;
        sql="SELECT customer1.username, customer1.FirstName, customer1.LastName, customer1.Address, customer1.city, customer1.state, customer1.contactno, productorder.orcode, productorder.ordate, productorder.icode, productorder.qty, productorder.rate, productorder.delidate
FROM customer1 LEFT JOIN productorder ON customer1.email = productorder.email
WHERE customer1.email="'" + Label1.Text + "'";
        adp = new SqlDataAdapter(sql,con);
        ds = new DataSet();
        adp.Fill(ds,sql);
        if (ds.Tables[sql].Rows.Count >= 0)
        {
            rd = new ReportDocument();
            rd.Load(Server.MapPath("CrystalReport7.rpt"));
            rd.SetDataSource(ds);
            CrystalReportViewer1.ReportSource = rd;
        }
    }


这是正确的吗?

因为我遇到了错误-语法不正确''..

请检查并告诉我.


is this correct?

Because I am getting the error - incorrect syntax near''.''.

Please check it and tell me.

推荐答案



这篇关于关于sql server的水晶报表中的疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 23:59