How fill the textbox with the DataSet values?

P

Patricio

Hello all
I have a form that contains several textbox.
I have also a DataSet that contains the Fill function by ID.
How can I assign the DataSet values into my TextBox?

Thanks a lot.
 
T

Tim_Mac

hi patricio
if you want a textbox for each record in the dataset then you should use one
of the List controls, such as DataList, GridView or Repeater.
i would use a DataList control based on the info you provided, because you
have more control over the controls rendered for each row. In the
ItemTemplate section of the DataList, insert some aspx code like this:

<asp:TextBox runat="server" Text='<%# Eval("DataBaseFieldName") %>' />

if you're using .Net 1.1, use the DataBinder.Eval(Container.DataItem,
"DataBaseFieldName") function instead of the short form of Eval().

it sounds like you may have manually created all the textboxes on the form.
this probably isn't the best approach if you want a textbox for each row in
the dataset. if this is intentional, please post more information on what
you are doing.

tim
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top