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:
strSQL = "SELECT UserId, UserPassword FROM Users Where UserId ='" & _ strUserName & "' AND UserPassword='" & strUserPassword & "'" objDAUsers = New SqlClient.SqlDataAdapter(strSQL, gstrDEVSQLSERVERCONN) If Not (objDAUsers Is Nothing) Then objDAUsers.Fill(objDSUserDetails) If Not (objDSUserDetails Is Nothing) Then Select Case objDSUserDetails.Tables(0).Rows.Count Case 0 LoginPassedValidation = False Case 1 LoginPassedValidation = True End Select End If End If
Thanks all!




Reply With Quote