Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null for a string
Message
 
 
À
07/05/2009 13:51:41
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01398411
Message ID:
01398414
Vues:
49
>ItemNo is a string. You assign null to a string like this:
ItemNo = null;
What are you trying to do? Assigning null to the string parameter or to a field of the datatable?
>
>>How can I fix this code
>public InventoryDS.ItemsDataTable Find(string ItemNo, string description)  
>>        {
>>            if (ItemNo.Equals(string.Empty))
>>            { ItemNo = DBNull.Value; } // Intellisense doesn't like it
>Both parameters set to allow DbNull.

BTW, would it allow it if it's not declared as string? It didn't complain in the code window.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform