Public Function GetUserProfile(ByVal strSQL As String) As Boolean Dim cmd As New OleDbCommand Dim rdr As OleDbDataReader = Nothing Dim strErrMsg As String Try cmd.CommandText = strSQL cmd.CommandType = CommandType.Text cmd.Connection = MyBase.cnDB rdr = cmd.ExecuteReader 'At this point, it give no row in DB If rdr.HasRows Then While rdr.Read With CurrUser If Not IsDBNull("ysnCollection") Then .bCollection = (rdr("ysnCollection")) Else .bCollection = False End If If Not IsDBNull("ysnMaintenance") Then .bMaintenance = (rdr("ysnMaintenance")) Else .bMaintenance = False End If If Not IsDBNull("ysnSecurity") Then .bSecurity = (rdr("ysnSecurity")) Else .bSecurity = False End If If Not IsDBNull("ysnReport") Then .bReport = (rdr("ysnReport")) Else .bReport = False End If Return True End With End While End If Catch ex As Exception strErrMsg = "Error in getting User Profile. " & MyBase.DBPath strErrMsg = strErrMsg & ControlChars.NewLine & ex.Message MsgBox(strErrMsg, MsgBoxStyle.Exclamation, strTitle) Return False End Try End Function
strSQL
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)