I've been unable to figure out how to do this although it ought to be really simple. I'm using VB 2012.
This is the basic reusable code which works fine. However, I need to test for an empty dataset (empty grid) at this point in the code and I can not seem to figure out how to do that. I've tried If (Data.Container is Nothing) then ... but that always is true. I'm not understanding something here ... could someone kindly set me on the right track?
TIA,
Ken
Code:
Dim connection As SqlConnection = clsConnection.GetConnection()
Dim DataAdapter As SqlDataAdapter = New SqlDataAdapter(SQL, connection)
Dim Data As DataSet = New DataSet
DataAdapter.Fill(Data, Grid)
Grid.DataSource = Data
TIA,
Ken