Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple syntax
Message
De
09/04/2016 04:56:21
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01634544
Message ID:
01634575
Vues:
36
(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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform