G
Guest
I'd like to pass a System.Type object to a sub.
The following works:
Public Sub main()
Dim connType As System.Type, obj As Object
obj = New System.Data.OleDb.OleDbConnection
connType = obj.GetType
foo(connType)
End Sub
Public Sub foo(ByVal connType As System.Type)
Dim t As System.Type, obj As Object
obj = New System.Data.OleDb.OleDbConnection
t = obj.GetType
If connType.Equals(t) Then
MessageBox.Show(connType.FullName & " type was passed.")
End If
End Sub
I'd like to change this so that:
- no objects are instantiated
- the code is concise
Thanks in advance for your help,
Hal Heinrich
VP Technology
Aralan Solutions Inc.
The following works:
Public Sub main()
Dim connType As System.Type, obj As Object
obj = New System.Data.OleDb.OleDbConnection
connType = obj.GetType
foo(connType)
End Sub
Public Sub foo(ByVal connType As System.Type)
Dim t As System.Type, obj As Object
obj = New System.Data.OleDb.OleDbConnection
t = obj.GetType
If connType.Equals(t) Then
MessageBox.Show(connType.FullName & " type was passed.")
End If
End Sub
I'd like to change this so that:
- no objects are instantiated
- the code is concise
Thanks in advance for your help,
Hal Heinrich
VP Technology
Aralan Solutions Inc.