Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Populating A Combobox - from Linq
Message
 
To
All
General information
Forum:
ASP.NET
Category:
LINQ
Title:
Populating A Combobox - from Linq
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01310803
Message ID:
01310803
Views:
71
I am trying to use LinqToSQL to populate a drop-down. I am returning the data, but when when I set the control source on the combobox, I'm note getting the columns data, but I am getting the right number of rows in the drop-down, not that it matters because I am getting:
ServerConnection.ct_Get_UserNames_AllResult
for the display value in the combobox. So I'm guessing I need to set the display member (or something else), but I'm not sure exactly what to set it to or what other options I should be looking at. Here is the code:
      DataSet ds = new DataSet();
      DataClasses1DataContext db = new DataClasses1DataContext();
      db.Connection.ConnectionString = connectionString;
      var Users = db.ct_Get_UserNames_All() ;
      comboBox1.DataSource = Users;
Thanks for any help

Kirk

Okay, it was just setting the Displaymember to the column name in quotes: "UserName"
Next
Reply
Map
View

Click here to load this message in the networking platform