I'm finally writin my first .net project using ado.net. What I need to do is check whether any of the rows in my sql database table contain a username & password I pass to i.

First off, is this the right way of going about this, then also, none of the examples in my wrox books list the set dataset = nothing equivalent, I guess the GAC does this for you now, but wondered if it's considered bad to put the setting to nothing options in with .net?

VB Code:
  1. strSQL = "SELECT UserId, UserPassword FROM Users Where UserId ='" & _
  2.         strUserName & "' AND UserPassword='" & strUserPassword & "'"
  3.  
  4. objDAUsers = New SqlClient.SqlDataAdapter(strSQL, gstrDEVSQLSERVERCONN)
  5.  
  6. If Not (objDAUsers Is Nothing) Then
  7.     objDAUsers.Fill(objDSUserDetails)
  8.  
  9.     If Not (objDSUserDetails Is Nothing) Then
  10.  
  11.         Select Case objDSUserDetails.Tables(0).Rows.Count
  12.         Case 0
  13.             LoginPassedValidation = False
  14.         Case 1
  15.             LoginPassedValidation = True
  16.         End Select
  17.  
  18.     End If
  19. End If

Thanks all!