에 Null 허용 문자열 매개 변수를 만드는 데 좀 도와주세요 어떻게 vb.net에서 문자열 형식의 Null 허용 매개 변수를 구현하는 방법을 가르쳐주십시오Vb.NET
기능 :
sub savedetail(byval name as string, byval age as integer)
if name isnot nothing then
some work
end if
end sub
난 것은
처럼 호출 오전savedetail(nothing,34) //here is giving me format exception
예외 : System.FormatException : 입력 문자열의 형식이 올바르지 않습니다. 내가 실수를하고 어디
지금은 배치하고 exect 기능 .. 제발 말해 :
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
전화 :
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)
정확한 텍스트는 예외입니다. – Bobby
예제가 제대로 작동합니다. 무슨 일이있을거야. –
FormatException이 'some work'루틴 내부에서 오지 않았습니까? –