Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple syntax
Message
From
09/04/2016 04:56:21
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01634544
Message ID:
01634575
Views:
35
(dr.Field<string>("gst_name") ?? String.Empty).Trim()......
?

>UPDATE. Never mind, solved it.
>
>Hi everybody,
>
>Just wondering if there is some simple syntax here to avoid the error.
>
>I have this expression:
>
>
>display_message = row.Field<String>("Request") + row.Field<String>("PaidStatus") +
>                   row.Field<String>("gst_name").Trim().Proper() + " " + 
>                   row.Field<String>("lsndescrip").Trim() + " " + Convert.ToString(row.Field<Decimal>("booking_id"));
>
>and right now it's failing because gst_name column is null.
>
>I'm wondering what is the simplest way to re-write this expression to treat null as empty string?
>
>Thanks in advance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform