Visual-Studio2008转换为Visual-Studio2015,Join无法按预期工作

时间:2016-10-14 13:57:07

标签: visual-studio-2015

我有一个Sub,它带来一个数组并在Mysql命令中使用它。

数组是COLUMN,它包含例如

Dim COLUMN  As String = {"column1","column2","column3"}

TABLE就像“SomeTable”一样字符串

Public Sub FillComboBox(ByVal TABLE As String, ByVal COLUMN As Array,  ...)

        Dim StrCOLUMN As String = String.Join(",", COLUMN)
        Dim sqlQuery As String = "SELECT " & StrCOLUMN & " FROM " & TABLE
        [...]

End Sub

这是我的问题

我期待的是像

"SELECT column1,column2,column3 FROM SomeTable"

我得到像

这样的东西
"SELECT System.String[] FROM SomeTable"

错误在哪里?

1 个答案:

答案 0 :(得分:0)

我确信COLUMN是一个阵列,就像Visual Studion 2008一样。但是自Visual Studion 2015以来似乎有所不同

Public Sub FillComboBox(ByVal TABLE As String, ByVal COLUMN As String(),  ...)

        Dim StrCOLUMN As String = String.Join(",", COLUMN)
        Dim sqlQuery As String = "SELECT " & StrCOLUMN & " FROM " & TABLE
        [...]

End Sub