Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for valid Guid in DataRow
Message
De
22/09/2008 13:07:18
 
 
À
22/09/2008 12:06:10
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01349517
Message ID:
01349544
Vues:
14
>Hi all,
>
>I need to verify a DataRow has valid values and thus I am checking my PK which is a Guid.
>
>I am doing this:
>
>if ((Guid)dr["Track_Id"] != null || (Guid)dr["Track_Id"] != Guid.Empty)
>{
>
>}
>
>
>I am getting a message "Unreachable expression code detected" on the last portion of the check.

Second expression would only be evaluated if (Guid)dr["Track_Id"] evaluated to null . I guess you intended &&......
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform