Hello! Faced the following problem. I am developing a chat, I have a list of rooms. I want to display it through ListBox'a. For this, I use LINQtoSQL to fetch data from a database:
var db = new LinqChatDataContext(); listRooms.DataSource = from r in db.Rooms where r.IsPrivate == "n" select r.RoomID; listRooms.DataBind();
The problem is that I want to display only the names of chat rooms in the list, while I need to get the id of the room so that I pass it as a parameter to open the chat itself. How to do it correctly in the LINQ request and how can I hide the room id, and display only its name in the list? Maybe I should use another control?