A
adiel_g
Hello everyone, I am trying to move a field name to a variable in
vb.net. For example, first I retrieve the record from the database
and save its value:
....
userGroup =
ds.Tables("Default").Rows(x).Item("UserGroupAccess").ToString
'retrive access value from dataset
....
Then, depending on the value retrieved I want to setup a specific
boolean variable to True:
....
objUserAccess.[userGroup] = True
....
In this case the table might contain records such as this:
UserName Access
======== =======
Bob Admin
John User
And the objUserAccess contains variables such as this
admin as boolean
user as boolean
In the example above, if the value of the table field UserGroupAccess
is equal to Admin, then
it should basically set admin to true. If we were to manually do this
it would be set by this statement:
....
objUserAccess.Admin = True
....
But instead of the above statement, It would be automated depending on
the value pulled from the database:
....
objUserAccess.[userGroup] = True
....
I would appreciate any help on finding the best way to accomplish
this.
Thanks Before Hand,
Adiel
vb.net. For example, first I retrieve the record from the database
and save its value:
....
userGroup =
ds.Tables("Default").Rows(x).Item("UserGroupAccess").ToString
'retrive access value from dataset
....
Then, depending on the value retrieved I want to setup a specific
boolean variable to True:
....
objUserAccess.[userGroup] = True
....
In this case the table might contain records such as this:
UserName Access
======== =======
Bob Admin
John User
And the objUserAccess contains variables such as this
admin as boolean
user as boolean
In the example above, if the value of the table field UserGroupAccess
is equal to Admin, then
it should basically set admin to true. If we were to manually do this
it would be set by this statement:
....
objUserAccess.Admin = True
....
But instead of the above statement, It would be automated depending on
the value pulled from the database:
....
objUserAccess.[userGroup] = True
....
I would appreciate any help on finding the best way to accomplish
this.
Thanks Before Hand,
Adiel