I am using MS SQL Server as my database and VB.NET as my back-end.
I want to determine if my query in sql command text returns no rows. I tried to have a query that returns no rows, and then give its value to a text box which became 0. (integer)
The problem now, is that when I test it in an If condition, it doesn't work. The code is like this:
If (Query that returns no rows) = 0 Then
'condition
Else
'condition
End If
I tried a blank string, but it still does not work. Please help! If possible, please give the simples solution to the problem. Thank you in advance!
!<enumerable>.Any(), but... hard to say more with the given code !executethe query. Otherwise nothing is happening. This will be much easier to fix if you paste ALL of the relevant code.