B
briancfk
I now converting vb6 code to vb.net code
Let me descrip my problem first
i got a Function e.g.
Public Function Method1(Byval ar as object, Optional ByVal strWHFrom As
String, Optional ByVal strWHTo As String) as string
........
If IsMissing(strWHFrom) And IsMissing(strWHTo) Then
strSql = "............"
ElseIf IsMissing(strWHFrom) And Not IsMissing(strWHTo) Then
strSql = "............"
ElseIf Not IsMissing(strWHFrom ) And IsMissing(strWHTo) Then
strSql = "............."
Else
If IsNull(strWHFrom ) And IsNull(strWHTo) Then
strSql = "................"
ElseIf Len(strWHFrom )=0 And len(strWHTo)=0 Then
strSql = "..............."
Else
If Trim$(strWHFrom ) = Trim$(strWHTo) Then
strSql = "............."
Else
strSql = "............."
End If
End If
End If
End Funciton
This function work well in vb6
But How I going to code this with vb.net, vb.net seem like cant
differentciate the parameter got pass in or not. and also how to
convert the IsNull
Is it mean that I must put some SPEACIAL default value to the Optional
Parameter to detect that particular parameter got pass in or not?
Thank you
Let me descrip my problem first
i got a Function e.g.
Public Function Method1(Byval ar as object, Optional ByVal strWHFrom As
String, Optional ByVal strWHTo As String) as string
........
If IsMissing(strWHFrom) And IsMissing(strWHTo) Then
strSql = "............"
ElseIf IsMissing(strWHFrom) And Not IsMissing(strWHTo) Then
strSql = "............"
ElseIf Not IsMissing(strWHFrom ) And IsMissing(strWHTo) Then
strSql = "............."
Else
If IsNull(strWHFrom ) And IsNull(strWHTo) Then
strSql = "................"
ElseIf Len(strWHFrom )=0 And len(strWHTo)=0 Then
strSql = "..............."
Else
If Trim$(strWHFrom ) = Trim$(strWHTo) Then
strSql = "............."
Else
strSql = "............."
End If
End If
End If
End Funciton
This function work well in vb6
But How I going to code this with vb.net, vb.net seem like cant
differentciate the parameter got pass in or not. and also how to
convert the IsNull
Is it mean that I must put some SPEACIAL default value to the Optional
Parameter to detect that particular parameter got pass in or not?
Thank you