I have a code like this:
DataRow[] drClaimCPT; drClaimCPT = dtCpt.Select("CLAIM_NUMBER == " + claimNo + "");
When I started, I received an error message:
Syntax error: Missing operand before '=' operator.
What did I do wrong?
This will work for you if the type is integer:
drClaimCPT = dtCpt.Select("CLAIM_NUMBER = " + claimNo + "");
for string:
drClaimCPT = dtCpt.Select("CLAIM_NUMBER = '" + claimNo + "'");
I assume your claimNo- number, the correct syntax is:
claimNo
number
dtCpt.Select("CLAIM_NUMBER = " + claimNo + "");
DataTable.SelectThe method uses the same rules with the DataColumn.Expressionproperty by the way.
DataTable.Select
DataColumn.Expression
If yours claimNois string, you should use single quotes with it.
string
dtCpt.Select("CLAIM_NUMBER = 'claimNo'");
From the documentation;
Custom values.
Custom values
.
Your actual problem was to use double '=' - this is the encoding equivalent - rememebr is SQL, so it should be "CLAIM_NUMBER = ClaimNo" and not "CLAIM_NUMBER = = requireNo".
Source: https://habr.com/ru/post/1526701/More articles:Call up the Gnome Shell Shortcut softkeys - gnome-3How to return a long sequence of characters in a string in java? - javaHow to find mdf / ldf locations in T-SQL? - sql-serverFailed to create commercial sandbox account for google wallet api for digital goods - android-payExplain to me where the "x" in the hexadecimal "0xf0" comes from - javaMKMapSnapshotter удаляет "Правовые" из моментальных снимков - iosHow to change delphi getter / setter property with RTTI? - rttiWCF service regarding uri without .svc - c #How can I hide the legal link to moomapview monotouch iPhone - iosVisual Studio function to automatically create matching catch blocks for exceptions? - c #All Articles