2013-07-21 48 views
0

我怎样才能有一个接受变量作为byref没有声明它是什么类型的变量(它可以是int,字符串等),但仍然有一些其他参数定义?我怎样才能有一个接受变量作为byref而不声明它是什么类型的变量?

我想这样子:

Private Sub example(ByRef variable, ByRef reader as MySqlDataReader, ByVal columnName as String) 
+0

'绝对reader'不应该是'ByRef'和'variable'可能不应该'ByRef'。 – SLaks

+0

发布您的真实代码。你的代码片段太虚假了,给你很好的建议。 –

回答

4

你可以做一个通用的方法:

Private Sub Example(Of T)(ByRef variable As T, ByRef reader as MySqlDataReader, ByVal columnName as String) 
相关问题