Click here to Skip to main content
15,901,368 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
protected void Button1_Click(object sender, EventArgs e)
        string sql;
        sql="SELECT customer1.username, customer1.FirstName, customer1.LastName, customer1.Address,, customer1.state, customer1.contactno, productorder.orcode, productorder.ordate, productorder.icode, productorder.qty, productorder.rate, productorder.delidate
FROM customer1 LEFT JOIN productorder ON =
WHERE"'" + Label1.Text + "'";
        adp = new SqlDataAdapter(sql,con);
        ds = new DataSet();
        if (ds.Tables[sql].Rows.Count >= 0)
            rd = new ReportDocument();
            CrystalReportViewer1.ReportSource = rd;

is this correct?

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

Please check it and tell me.
Updated 10-Feb-11 1:42am
Sandeep Mewara 10-Feb-11 7:54am    
Also, when you debug it, which line says error? Looks like SQL only, but do confirm.

If your code snippet was pasted into your question, then I am not surprised that it gave errors. There were no spaces anywhere in your sql string. I have attempted to edit it. Please check that it is correct.
Share this answer
BTW, this line is also wrong:

It should be:
Share this answer

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

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