Like so (called the conditional operator or conditional ternary operator):
bool booleanStatement = true;
string resultValue = booleanStatement ? "The true part" : "The false part;
// set to "The true part"
--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
"Bobbo" <an*******@discussions.microsoft.com> wrote in message
news:FD**********************************@microsof t.com...
Hi All,
Learning C# - what is the equivalent in C# for the following statement?
al.CompanyID = IIf(IsDBNull(d("CompanyID")), "", d("CompanyID"))
I don't see anything in C# that provides for this one line type of syntax.
Seems I have to use a If-else block for each in C#.
True or am I missing something?
Appreciate anyone that can clear this up for me.
thanks...Bobbo