Have a read of
Two-Way Data Binding in ASP.NET[
^]
** UPDATE **
You are trying to use WinForm data binding with a WebForm this does not work.
If you read the article you should have read the section entitled "
Simple DataBinding - a (brief) refresher" and seen the
DataBinder.Eval() Method[
^] which is what is used to databind controls in WebForms.
To use the
DataBinder.Eval()
method in CodeBehind;
TextBox1.Text = DataBinder.Eval(ds.Tables["Products"].DefaultView[0], "ProductName").ToString();
This method also has the option to specify a format string;
TextBox2.Text = DataBinder.Eval(ds.Tables["Products"].DefaultView[0], "ProductPrice", "{0:c}");
If however all you want is to do is change the text of a label based on a database field you could just use
string.Format()
like;
Label1.Text = string.Format("{0}", ds.Tables["Products"].DefaultView[0]["Description"]);
Keep in mind that WebForm databinding does not work the same way as WinForm databinding and attempt to comprehend how things work.