s'il vous plaît me dire comment mettre en œuvre Nullable paramètre de type chaîne dans vb.nets'il vous plaît aidez-moi à créer Nullable paramètre de chaîne dans Vb.NET
Fonction:
sub savedetail(byval name as string, byval age as integer)
if name isnot nothing then
some work
end if
end sub
je l'appelle comme la chose
savedetail(nothing,34) //here is giving me format exception
exception: System.FormatException: la chaîne d'entrée n'était pas dans un format correct.
Maintenant, je suis placer la fonction exect .. s'il vous plaît me dire où je fais erreur:
Function savedetails(ByVal db As DSLibrary.DataProviders.SqlProvider, ByVal name As String, ByVal cityId As Integer, ByVal addr1 As String, ByVal addr2 As String, ByVal phone As String, ByVal fax As String, ByVal zip As String, ByVal contactfname As String, ByVal contactlname As String, ByVal randomcode As String, ByVal reservationEmail As String, ByVal email As String, ByVal url As String, ByVal description As String, ByVal locationInfo As String, ByVal amenities As String, ByVal roomDetails As String, ByVal latitude As Double, ByVal longitude As Double, ByVal enabled As Integer, Optional ByVal hotelId As Integer = Nothing, Optional ByVal checkDuplicate As Boolean = True, Optional ByVal DSPartner As Integer = Nothing, Optional ByVal category As String = Nothing, Optional ByVal rating As Integer = Nothing) As Integer
appel:
savedetails(db, hotelname, 0, address, Nothing, Nothing, Nothing, postal, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, hotelinfo, Nothing, service, Nothing, Convert.ToDouble(lat), Convert.ToDouble(longi), 1, Convert.ToInt32(hotelid), False, dspartnerid)
Le texte exact de l'exception s'il vous plaît. – Bobby
Votre exemple fonctionne bien. Il doit y avoir quelque chose d'autre qui se passe. –
Etes-vous sûr que l'exception FormatException ne provient pas de votre routine 'un peu de travail'? –