CODE
var searchid = textBox1.Text.Trim();
var quer = (from p in std.student
where p.StudId.Text.ToString(quer)
select p).Count();
dataGrid1.ItemsSource = quer;
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjay KumarRank #561 · 4.3K reputationPosted Dec 12, 2013, 9:09 PM EST
var searchid = Convert.ToInt32(textBox1.Text.Trim());
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Dec 12, 2013, 9:14 PM EST
var searchid = textBox1.Text.Trim();
Please let me know if you are expecting anything else.
Sanjay KumarRank #561 · 4.3K reputationPosted Dec 12, 2013, 9:30 PM EST
http://stackoverflow.com/questions/3853010/get-item-count-of-a-list-using-linq
http://stackoverflow.com/questions/14865099/with-linq-get-count-of-items-that-satisfy-criteria-in-grouping
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 13, 2013, 1:04 AM EST
ItemsSource property of any control is type of IEnumerable, so accept only those value.
here you are trying to assign int value to ItemsSource property...
var searchid = Convert.Toint32(textBox1.Text.Trim());
var quer = (from p in std.student
where p.StudId == searchid
select p);
dataGrid1.ItemsSource = quer;
hope this will help you.