How does DataBinding work?

G

Guest

When I click on the DataBinding in the properties window a list of options
open up called Advanced,Tag and Text. I would like to know what Tag and Text
are set to? I hope to Bind a text box to a Access database in my program.
 
C

Cor Ligthert

Shane,

Did you do everything,
(creating the databaseconnection, dataset and dataadapter) using the
designer?

Than you can take the text property from the bindings and click on the +
from the dataset until you find the proper field.

In your load event you can than place something as:
Me.SqlDataAdapter1.Fill(Me.DataSet11)

I hope this helps?

Cor
 
C

Cor Ligthert

Shane,

You did the connection stuff, however for this question it is important to
know what parts of the designer you did use. You can do almost everything
with the designer and use completly nothing. That is important for the
databinding when using the designer, a normal databinding done in code is.

textbox1.DataBindings.Add(New Binding("Text", dataset1.Tables(0),
"LastName"))

The text part is your Text property from your control which can as well by
the Tag property from that when you want other properties you can use the
advanced property tab from the designer.

I hope this answers your question so far?

Cor
Thanks for the Reply Cor,
Yes I have already done the connection stuff. I just need help understanding
how to update a database by using a txtBOX. I can update the database by
using a Upload button, but that is not what I was hoping to do. I know that
I have to Bind the txtBOX to the access data table but I really don't
understand what Tag and Text are used for.
 

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

Top