Ok. You had
cmdText2 = "SELECT * FROM XTABLEX" in class declaration and it gave you that error.
Dim cmdText2 as String = "SELECT * FROM XTABLEX" works in class declaration?
To get it to work in application you have to have some function/sub where to do replacing. Is this possible? You mentioned dropdown box:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'
' Get table name from dropdown box, build SQL and...
Dim strSQL As String
strSQL = cmdText2.Replace("XTABLEX", strTableName)
' Use strSQL
End Sub
Can you use it in this way?
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Offline 1,024 posts
since Aug 2008