S
simon
Hello
in my codebehind for a user preference form, i instantiate a new
class, and then call a function in that class. the function calls a
proc which returns a dataset (in this case a single row from the
database with some stored user preferences). this is all done in the
"Not Page.IsPostBack" IF block, so that is only runs the first time a
page is loaded.
what i'm trying to figure out is how to reference individual data
elements from the returned dataset and then pre-populate the form for
the user (meaning they have already stored their choices)
so what i have in codebehind.vb....
Dim myClass As New DBclass
Dim userPrefs As DataSet =
DBclass.GetUserDraftPrefs(Session("groupID"), Session("UserID"))
Dim userPrefCount As Integer = userPrefs.Tables(0).Rows.Count()
If userPrefCount > 0 Then
here is would want to say something like:
ddl1.selectedvalue = "the value pulled from the dataset for saved
dropdownlist1"
and so on for the other form elements
End If
i'm guessing this is pretty straight forward.
don't know the statement/syntax yet though. is it like an array where
each "column" in the dataset would be accessed by an index?
thanks for any insight/code-sample !!
in my codebehind for a user preference form, i instantiate a new
class, and then call a function in that class. the function calls a
proc which returns a dataset (in this case a single row from the
database with some stored user preferences). this is all done in the
"Not Page.IsPostBack" IF block, so that is only runs the first time a
page is loaded.
what i'm trying to figure out is how to reference individual data
elements from the returned dataset and then pre-populate the form for
the user (meaning they have already stored their choices)
so what i have in codebehind.vb....
Dim myClass As New DBclass
Dim userPrefs As DataSet =
DBclass.GetUserDraftPrefs(Session("groupID"), Session("UserID"))
Dim userPrefCount As Integer = userPrefs.Tables(0).Rows.Count()
If userPrefCount > 0 Then
here is would want to say something like:
ddl1.selectedvalue = "the value pulled from the dataset for saved
dropdownlist1"
and so on for the other form elements
End If
i'm guessing this is pretty straight forward.
don't know the statement/syntax yet though. is it like an array where
each "column" in the dataset would be accessed by an index?
thanks for any insight/code-sample !!