Get Data value in FormView

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

I know how to use the FindControl to get the value of a TextBox, etc. in a
FormView_Databound event as shown below.

Dim row As FormViewRow = fvPeople.Row
Dim ddl As DropDownList = row.FindControl("ddlCaseWorkerID")

But I need to retrieve the value in a dataset that is the Datasource of the
FormView but it is not being displayed on the FormView. Thanks.

David
 
Mark Rae said:
You didn't mention any of that in your OP - you said: "I need to retrieve
the value in a dataset that is the Datasource of the FormView but it is
not being displayed on the FormView."

Please explain *exactly* what you need...

I am using code to obtain values in a DropDownList control named ddlRaceID.
Since I am using RaceID as a parameter in my update statement then I need to
bind it to something. Normally it would be bound as SelectedValue of the
DropDownList but I cannot do that when filling via code. So I need to get
the current value of the column named RaceID from the dataset but that
column is not bound anywhere in controls.

Does that help?

David
 
Mark Rae said:
That makes no sense at all, at least, not to me... Why do you need to bind
anything to anything in order to update a record in a database...?

How else would I get the value that is selected in the DropDownList when
someone changes it?
 
Mark Rae said:
I guess so, if you're still determined not to use a DAL...

No, I still want to use DAL but it still needs update values, correct? I
have not gotten into DAL for updates yet...only on inserts. But I am trying
to change my thinking patterns that I have used for so long.

David
 
Back
Top