Microsoft
Software
Hardware
Network
Question : How to use two values in a VB.NET ComboBox
My situation is that I have a form called "Batch" that has a ComboBox that needs to be filled with User names. Once the user selects a name, I need to get the UserID for that name. I've tried using a DataSet, but I don't know how to retrieve the information from it. My SQL statement is:
mySQL = "SELECT UserID,LoginName " & _
"FROM Users " & _
"ORDER BY LoginName;"
Using the DataSet for the DataSource of the ComboBox property doesn't work. It doesn't work either if I select just the LoginName in mySQL. I've also thought of using a collection to store the information, but I couldn't figure out how to do that.
What I've tried is: cboLoginName.DataSource = myDataSet, and it doesn't work.
In your answer, I'll need clear and complete code because I am new to VB.NET. I want to implement this entirely in code.
I know that my DataSet contains the correct data, because I set the DataSource in a DataGridView to myDataSet, and that worked.
I hope someone can help, and that I explained my problem clearly.
Thank you!
Agent909
Answer : How to use two values in a VB.NET ComboBox
Agent909,
No problem. Glad to help.
Ashok
Random Solutions
How can I change the colour of text in a report field to match a colour specified in the report?
-2147467259 [Microsoft][ODBC SQL Server Driver][DBNETLIB]Connectio<wbr />nWrite(Wra<wbr />pperWrite(<wbr />))
Export 4 Queries to the same Worksheet
Receive Connector for Exchange 2007 Server to Receive From Barracuda FW 300
Remote Desktop- blank screen
ORACLE SQL DEVELOPER reports error
Year to Year Sales Comparison Report
how to display mapped network drive information in windows explorer
AUTOCHK.EXE COULD NOT FOUND!
Linked table manager (Access 2003) does not show any tables