Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To 'Move the pointer' in a DataSet
Message
From
12/03/2009 20:21:14
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01386929
Message ID:
01387565
Views:
45
>Aha! Thanks for explaining that.

No problem Mike ... I've probably explained it a half a dozen times at least (easier than hunting for the first original message and posting a link). <g>

~~Bonnie



>>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.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform