Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
I have a Listview named "listview1". I am displaying students name in the list view. I got collecti...
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
sarin s
12y
1.7k
1
Reply
I have a Listview named "listview1". I am displaying students name in the list view.
I got collection of students Id and name in a data table.
// appending the students name in the listview
foreach (DataRow dr in dtStudentInfo.Rows)
{
Item = listView1.Items.Add(dr["strName"].ToString());
Item.Tag = dr["nId"].ToString();
}
question : How can i get name of the student if i know the student Id?
Eg: For the student Id 5 i want to know the name of the student.
Here i can do this by getting whole item collection inside a for loop and
i can compare the tag. But i want a direct method where i can specify the tag as 5 and get
student name for the respective tag?
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Get the value of textbox100, but the textbox100 is in Form2.
Auto increment the number after clicking submit button in c#.net calling store procedure