DougGerlach
Member
- Joined
- Jun 18, 2008
- Messages
- 7
- Programming Experience
- 1-3
i have the following code
when i run the code i expect to get back a value for the groupid that i query, but i get nothing. when i go and remove the where clause of the query it returns a record. i know my where clause is correct with the proper field names and values. has anyone ever seen this before?
thanks
doug
VB.NET:
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports System.Data
Imports System.Data.Common
Public Class DataClass
Private _tadb As Microsoft.Practices.EnterpriseLibrary.Data.Database = _
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase("TADBConnectionString")
Private Shared ReadOnly _instance As DataClass = New DataClass
' Entry point into this singleton
Public Shared ReadOnly Property Instance() As DataClass
Get
Return _instance
End Get
End Property
Public Shared Function ValidLogin(ByVal id As String, ByVal pass As String) As String
'Dim retval As Boolean = False
Dim sqlQuery As String = "select groupid from security where login_id = '" & id & "' and [password] = '" & pass & "'"
Dim command As DbCommand = _instance._tadb.GetSqlStringCommand(sqlQuery)
Dim retVal As String = _instance._tadb.ExecuteScalar(command)
command.Connection.Close()
command.Dispose()
Return retVal
Return retval
End Function
End Class
when i run the code i expect to get back a value for the groupid that i query, but i get nothing. when i go and remove the where clause of the query it returns a record. i know my where clause is correct with the proper field names and values. has anyone ever seen this before?
thanks
doug