Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To 'Move the pointer' in a DataSet
Message
 
 
To
12/03/2009 00:34:50
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01386929
Message ID:
01387378
Views:
45
>Cetin's example, using a BindingSource will work fine. But you don't have to use a BindingSource to get this to work, you just have to understand what it is that you missed.
>
>There are two ways (two different syntaxes) to specify databinding for any control if you're binding to a DataTable in a DataSet and this results in two distinct binding objects. The problem is that you can't mix and match ... you have to stay consistent throughout the form.
>
>So, in other words, if you bound your ListBox with:
>
>this.lstBackups.DataSource = _dsBackups;
>this.lstBackups.DataMember = "Backups";
>
>Then you have to use the following syntax with TextBoxes:
>
>this.txtDescription.DataBindings.Add("Text", _dsBackups, "Backups.LastName")
>
>
>But since you bound your ListBox with:
>
>this.lstBackups.DataSource = _dsBackups.Tables["Backups"];
>
>Then you must use this syntax for TextBoxes:
>
>this.txtDescription.DataBindings.Add("Text", _dsBackups.Tables["Backups"], "Description");
>
>
>The second option is the preferable methodology, BTW.
>

Aha! Thanks for explaining that.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform