This is my code in vb6. How to in vb.net??? Please tell me. I'm stuck in here..
Public Function LookUpST(ByRef adcCON As ADODB.Connection, strSTT As String, Optional vntHasil As Variant, Optional vntRETURN As Variant, Optional vntNEXT As Variant, Optional vntNEXT_TO As Variant) As Boolean
On Error GoTo ErrHndl
Dim adrLook As New ADODB.Recordset
adrLook.CursorLocation = adUseClient
adrLook.Open strSTT, adcCON, adOpenKeyset, adLockReadOnly
If adrLook.RecordCount > 0 Then
adrLook.MoveFirst
If Not IsMissing(vntHasil) Then
vntHasil = IIf(IsNull(adrLook(0)), Empty, adrLook(0))
End If
If Not IsMissing(vntRETURN) Then
vntRETURN = IIf(IsNull(adrLook(1)), Empty, adrLook(1))
End If
If Not IsMissing(vntNEXT) Then
vntNEXT = IIf(IsNull(adrLook(2)), Empty, adrLook(2))
End If
If Not IsMissing(vntNEXT_TO) Then
vntNEXT_TO = IIf(IsNull(adrLook(3)), Empty, adrLook(3))
End If
adrLook.Close
LookUpST = True
Else
vntHasil = ""
vntRETURN = ""
vntNEXT = ""
vntNEXT_TO = ""
LookUpST = False
End If
Set adrLook = Nothing
Exit Function
ErrHndl:
LookUpST = False
MsgBox Err.Description, vbCritical, "Error"
End Function