954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Incprrect Syntax Problem

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

Traicey
Posting Whiz in Training
283 posts since Mar 2008
Reputation Points: 26
Solved Threads: 19
 

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

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

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

Traicey
Posting Whiz in Training
283 posts since Mar 2008
Reputation Points: 26
Solved Threads: 19
 

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

Kusno
Junior Poster
191 posts since Aug 2007
Reputation Points: 11
Solved Threads: 17
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You