Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with null value
Message
De
09/06/2014 15:32:56
 
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601518
Message ID:
01601521
Vues:
32
Can you just pass null without casting to Int64?

>I am re-writing my code now this way:
>
>
>  SqlParameter gstPassNo = insertCommand.Parameters.Add("@gstPassNo", SqlDbType.Decimal, 17);
>                if (this.passTable == PassTable.Gst_Pass)
>                    gstPassNo.Value =   passNo;
>                else 
>                    gstPassNo.Value = DBNull.Value;
>
>
>after finding this link
>
>http://stackoverflow.com/questions/4555935/how-to-assign-null-to-a-sqlparameter
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform