gavriel ankri

gavriel ankri

  • NA
  • 39
  • 48.5k

display data from sql table in a label

Feb 22 2012 1:23 PM
Hello.  I am novice and I have a very easy question.

I would like to display content from sql table on a label.
I am using enities so I tried this code:

            DBprojectModel1.DBprojectEntities1 context = new DBprojectModel1.DBprojectEntities1();


lbFullName.Text = from name in context.Pupils
where name.UserName.Contains(txtUser.text)
select name.FullName;

I am not sure how to write it correctly so the column FullName will be display in lbFullName.Text

and another question -  if I want  "txtUser.text"  to be exactly the same like name.UserName (and not only contains) what should I write ?

thank you!


Answers (1)