471,350 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

2 listbox questions

When loading my listbox, if the following gives me just the employeeID number;

Dim dv As DataView = dsEmployeeTree.Tables("SuperInfo").DefaultView
Me.lbxEmployee.DataSource = dv
Me.lbxEmployee.DisplayMember = "employeeid"
And the following gives me the full name of the employee;

Dim dv As DataView = dsEmployeeTree.Tables("SuperInfo").DefaultView
Me.lbxEmployee.DataSource = dv
Me.lbxEmployee.DisplayMember = "FullName"

What must I do to concatenate the two into a field that gives the following:

“employeeID, FullName”?

Now, in a lbxEmployee_SelectedIndexChanged procedure…
And, assuming that employeeID is displayed in the listbox, after I select
that item, why can’t I do the following:

strEmpString = CType(lbxEmployee.SelectedItem, String)

without getting the error, “Cast from type 'DataRowView' to type 'String' is
not valid”?

Thanks for helping me out on this!

--
JMorrell
Jul 21 '05 #1
0 752

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by wallacej | last post: by
4 posts views Thread by questions | last post: by
3 posts views Thread by Reb | last post: by
8 posts views Thread by Steve Schroeder | last post: by
4 posts views Thread by Mike Parris | last post: by
3 posts views Thread by George | last post: by
1 post views Thread by Spock | last post: by
reply views Thread by John Dann | last post: by
1 post views Thread by John | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.