G
Guest
I have 2 classes (below). I am not able to set the fields in the User class
from the Connection class (marked 1 -5). No errors are thrown. I am
returning values from the db correctly because I can put them in variables
and display.
I hope I have explained my problem ok. What am I missing?
I am on 1.1 using VS.net 2003
Thanks for your help
Mike
'CODE
1) User - with these pertinent methods
Public Sub setUserRights(ByVal str As String)
userRights = str
End Sub
'/////////////////
Public Function getUserRights() As String
Return userRights
End Function
2)Connection -- with these pertinent methods
Imports BalanceOmatic.cUser
Dim cUser As New cUser
Public Sub getUserRightsFromDB(ByVal userlogin As String)
Dim SQL As String
Dim strUserRights As String
SQL = "Select ID, USER_ID, USER_NAME, USER_EMAIL, " & _
"USER_RIGHTS From TAB_USER_RIGHTS Where USER_LOGIN = '" & userlogin
& "'"
Try
Me.OraComm.CommandType = CommandType.Text
Me.OraComm.CommandText = SQL
Me.openDB()
Dim dr As OracleDataReader = Me.OraComm.ExecuteReader()
dr.Read()
1 cUser.setDbID(CType(dr.Item(0), Integer))
2 cUser.setUserID(CType(dr.Item(1), Integer))
3 cUser.setFullName(CType(dr.Item(2), String))
4 cUser.setEmailAddress(CType(dr.Item(3), String))
strUserRights = CType(dr.Item(4), String).ToString
Me.closeDB()
5 cUser.setUserRights(strUserRights)
Catch ex As Exception
MsgBox(ex.ToString)
Finally
Me.closeDB()
End Try
End Sub
from the Connection class (marked 1 -5). No errors are thrown. I am
returning values from the db correctly because I can put them in variables
and display.
I hope I have explained my problem ok. What am I missing?
I am on 1.1 using VS.net 2003
Thanks for your help
Mike
'CODE
1) User - with these pertinent methods
Public Sub setUserRights(ByVal str As String)
userRights = str
End Sub
'/////////////////
Public Function getUserRights() As String
Return userRights
End Function
2)Connection -- with these pertinent methods
Imports BalanceOmatic.cUser
Dim cUser As New cUser
Public Sub getUserRightsFromDB(ByVal userlogin As String)
Dim SQL As String
Dim strUserRights As String
SQL = "Select ID, USER_ID, USER_NAME, USER_EMAIL, " & _
"USER_RIGHTS From TAB_USER_RIGHTS Where USER_LOGIN = '" & userlogin
& "'"
Try
Me.OraComm.CommandType = CommandType.Text
Me.OraComm.CommandText = SQL
Me.openDB()
Dim dr As OracleDataReader = Me.OraComm.ExecuteReader()
dr.Read()
1 cUser.setDbID(CType(dr.Item(0), Integer))
2 cUser.setUserID(CType(dr.Item(1), Integer))
3 cUser.setFullName(CType(dr.Item(2), String))
4 cUser.setEmailAddress(CType(dr.Item(3), String))
strUserRights = CType(dr.Item(4), String).ToString
Me.closeDB()
5 cUser.setUserRights(strUserRights)
Catch ex As Exception
MsgBox(ex.ToString)
Finally
Me.closeDB()
End Try
End Sub