I have the ff error and I have no idea what is

Line 1: Incorrect syntax near ','.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ','.

Source Error:
Line 101: dgItems.SelectedItem.Cells[0].Text;
Line 102:
the application point the error in the ff line that fills in the dataset
Line 103: daDetails.Fill(dsDetails, "Products");
Line 104: dgDetails.DataSource = dsDetails;
Line 105: dgDetails.DataMember = "Products";

If u know what might be the reason please let me know

Recommended Answers

All 3 Replies

Silly question, end of line System.Data.SqlClient.SqlException what you got colon ":" or semicolon ";" ?

No I got the problem, those are actually the details of the error not my code, so thats not silly....

so the problem was that I was refering to the cell in my datagrid which was a buttoncolumn dgItems.SelectedItem.Cells[0].Text; add to cart actually, instead of productID cell which resides in cells[2]. I just thought that datagrid doesnt refer to button columns as cells and that was silly

Thanx hey

Maybe your problem is in your SQL Query..:icon_question: ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.