Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Don't see the error
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01572968
Message ID:
01572985
Views:
30
>Hi everybody,
>
>I am not sure why I am getting the error 'can not implicitly convert string booking type to Boolean') when I try to apply C# iif as in this command
>
>
>sqlCommand.CommandText = "SELECT * FROM dbo.b_sched WHERE " + columnName + 
>                  @" = @columnValue and start_time IS NOT NULL 
>                       AND layer < 7 and is_pod" + ("POD"== bookingType)?">0":"=0";
>
>bookingType defined as String.
>
>Do you see what is wrong in this expression and why C# doesn't like it?


I think you need a space between and is_pod[SPACE HERE?]" + ("[OR SPACE HERE?]POD"==
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform