Get Data value in FormView

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
 
D

David C

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
 
D

David C

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?
 
D

David C

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top