I am getting this error in condiotional operator.
string remarks="";
AddDgvNew[6, i].Value==null?remarks="":remarks=AddDgvNew[6,i].Value.ToString();
Yes - because you're not doing anything with the result of the conditional expression. You've got a conditional expression which is trying to be a whole statement. In a simpler version:
bool condition = true;
int x = 10;
int y = 5;
// This is invalid
condition ? x : y;
What did you want to do with the result of the conditional expression? If the point was to assign it to a variable, then you need to do that. Currently you have two separate statements: one declares remarks
and assigns it a value; the second is just the conditional expression.
If you're trying to do something else, you'll need to clarify what you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With