i have desiged a database project and on form i want to retrieve two fields from listbox, how
as:
i am manually assigning a colum of table eg:["username"] to listbox and.
when i select a item from listbox then i need empid of that selected item not the username.
code:
for (int a = 0; a < dt.Rows.Count-1; a++)
{
listBox1.Items.Clear();
listBox1.Items.Add(dt.Rows[a]["username"]);
listBox1.ValueMember = dt.Rows[a]["empid"].ToString();
}
kindly help me to solve that problem.