pasan herath

pasan herath

  • NA
  • 21
  • 27.5k

Listbox to textbox entity framework

Aug 26 2013 5:22 AM
using (omni = new Model.MyOmniInventoryEntities()) {

  listBox1.DataSource = omni.NEWUSERs;
  listBox1.DisplayMember = "FNAME";
  listBox1.ValueMember = "USERID";
  }

using this I fill my listbox
I have a (fnametxt) textbox.I need to get my display member to my text box.
how i do this
please help
thankz
ENTITY FRAMEWORK
Is there any friend to help me in entity framework



when i select a one item in my list box {in listbox1} I need to display it on a textbox
how i do it



var query = from c in omni.NEWUSERs where
c.USERID.Equals(Convert.Int32(listbox1.selectedValue.ToString())) select new {
     fname = c.FNAME;
  }

var item = query.ToList();

                foreach (var u in item)
                {
                    FirstNametxt.Text = u.fistnametxt;
                }

what are the errors of this code.I can't find them
please help.
thankz


Answers (1)