Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding field to a textbox
Message
 
 
To
29/11/2002 18:33:43
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00728265
Message ID:
00728335
Views:
15
Bonnie,

Thank you very much. I will use your example (although I thought you use ME. instead of THIS. in VB.NET. However, I just started learning VB so I was probably missing this syntax).

Dmitry

>Dmitry,
>
>You don't need to create a DataView, you can bind directly to a DataSet's table. For a TextBox, you would bind to the Text property. Something like this:
>
>
>this.MyTextBox.DataBindings.Add("Text", MyTable, "CustomerID");
>
>
>This is how to do it programmatically, not from the property sheet.
>
>HTH,
>~~Bonnie
>
>>For some reason, all the tech documents and msdn articles like to show examples of binding data to grids but poor textboxes are always forgotten <g>.
>>
>>My questions are:
>>1. Should I create a DataView on a DataTable in DataSet for binding to textboxes? (or I can and should bind directly to DataSet?)
>>2. Say I create a dataset dstCustomers in the Page_load method. This dataset has a field CustomerID. What should I enter in the DataBindings property of the textbox txtCustomerId? (If I click on the [...] next to the DataBinings property, I get Data Bindings dialog but I could not see how to assing the field from the dataset there).
>>
>>TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform