Hey guys,
I'm just wondering if it's possibe to get the results from a query and then assign the results to a variable. So I will run a query which will return the names of the tables stored in the database, then I want them to be stored in a variable. So it would be something along the lines of:
Dim strFrom AS String = "FROM "
strQuery = "SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'Database1'"
con.Open()
theQuery.Connection = con
theQuery.CommandText = strQuery
theAdapter.SelectCommand = theQuery
theAdapter.Fill(theTable)
strFrom &= theTable
con.Close()
Is this the right way to do this? Or am I going completely wrong?
Thanks in advance :)