Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To 'Move the pointer' in a DataSet
Message
De
10/03/2009 13:48:24
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01386929
Message ID:
01386946
Vues:
51
>I have a DataSet bound to a listbox. When the user selects an item in the listbox, I want to display the description in a textbox which is below the list.
>
>I have:
>
>
>lstBackups.DataSource = _dsBackups.Tables["Backups"];
>lstBackups.DisplayMember = _dsBackups.Tables["Backups"].Columns[1].ColumnName;
>lstBackups.ValueMember = _dsBackups.Tables["Backups"].Columns[0].ColumnName;
>
>txtDescription.DataBindings.Add("Text", _dsBackups, "Backups.Description");
>
>
>The bindings work fine, but when I select a new list item, the description does not change. What am I missing?
 private BindingSource backupsBindSource = new BindingSource();
// ...
backupsBindSource.DataSource = _dsBackups.Tables["Backups"];
lstBackups.DataSource = backupsBindSource;
lstBackups.DisplayMember = _dsBackups.Tables["Backups"].Columns[1].ColumnName;
lstBackups.ValueMember = _dsBackups.Tables["Backups"].Columns[0].ColumnName;

txtDescription.DataBindings.Add("Text", backupsBindSource, "Description");
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform