I want to paste table name as function parameter and function need to return DataSet, this is the my code for that:
Public Function GetTTabele(ByVal tableName As String) As DataSet
Dim DAT As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM tableName", nwindConn)
Dim DAT As DataSet = New DataSet()
DAT.MissingSchemaAction = MissingSchemaAction.AddWithKey
DAT.Fill(DAT, tableName)
GetTTabele = DAT
End Function
Now when i execute this code I'm getting next error: System.Data.SqlClient.SqlException: Invalid object name 'tableName'.