>I guess the only way would be to set a property when I know I can fill the dataset:
>
>
> Using loSQLConnection As New SqlConnection(cConnectionString)
> oCommand.Connection = loSQLConnection
> nResult = oDataAdapter.SelectCommand.ExecuteNonQuery()
>
> ' If we can fill
> If lDataSet Then
> oDataAdapter.Fill(oDataSet)
> End If
>
> End Using
>
>
>Is there something simpler than that I can use to avoid setting up a property?
If you do 'ExecuteNonQuery' I think it automatically means that the query will not return a dataset. Only ExecuteReader returns a dataset.
If it's not broken, fix it until it is.
My Blog