Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there an equivalent to the recordset index in vb.net
Message
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
00735968
Message ID:
00735978
Views:
7
Hi Karl,

You can use the SelectedIndex property of the combobox to perform the lookup in the DataTable assigned to it. Here is an example:
// This code sets the source of the combobox
this.comboBox1.DataSource = this.dataSet1.Tables["MyTable"];
this.comboBox1.DisplayMember = "MyField";
this.comboBox1.ValueMember = "MyField";

// Somewhere in code where you need to find out the selected item in the combobox
DataRow dr = this.dataSet1.Tables["MyTable"].Rows[this.comboBox1.SelectedIndex];
>I was able to bind a database column to a combobox. now my problem is after the user selects an item from it. how will i know the current index or position of the item in the database w/o doing another select statement? (saves some processes)
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform