Click here to Skip to main content
16,013,082 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datatable and i am getting 2 rows like Recommendations and priority and whenever Contact Specialist text is there i want to make it null

C#
if (_dtrecomendationData.Select("Priority = 3").Length > 0)
                   {
                       DataRow[] dr = _dtrecomendationData.Select("Recommendations = Contact Vibration Specialist");

                       foreach (DataRow dre in dr)
                       {
                           dre["Recommendations"] = "--";
                       }
But i am getting an error like [System.Data.SyntaxErrorException] = {"Syntax error: Missing operand after 'Vibration' operator."}
Posted
Updated 8-Aug-14 3:22am
v2

1 solution

I think you need apostrophes around your value:

"Recommendations = 'Contact Vibration Specialist'");
 
Share this answer
 
Comments
SteveyJDay 8-Aug-14 13:03pm    
You are correct about the quotes.

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