From: Andy O'Neill on

"mick" <coughcough(a)privacy.com> wrote in message
news:ubQiWIztKHA.928(a)TK2MSFTNGP04.phx.gbl...
>I have a property "TotalCost" of type int and a TextBox "tbTotalCost" in
>the main form "Form1"
> and was wondering how to bind one to the other
>
> tbTotalCost.DataBinding.Add("Text",this.TotalWinnings, erm);
>
> First peram. should be Property Name but in the examples Ive seen it
> usually
> has "Text". Guessing its because it is the Text property of the TextBox?
>
> Second peram. should be object DataSource. That the propery?
>
> Third should be DataMember. Erm...
>
> Flailing around a bit as you can see.
>
> mick

It's a web screen, right?

Overall, what is your application doing?
User one end..... what is the other?
What goes on inbetween?

It would be more usual for you to have a database or some other data store.
Then some data access layer between your screen and the store.
Maybe involving a web service.
That would present some typed object to the screen for binding.
Binding to properties of the screen doesn't make much sense.
Well, outside of richly interactive WPF applications.

I guess you don't understand how to architect an application and you've
dived into coding..
You're probably best looking at books which present complete recipes.
Even the most extensive online examples tend to gloss over or trivialise
things which are important in real world apps.

Hope this is of some help.