Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi dear!
I have a database which has table name student and I want to show All table data in label controls so how can I do this.

please Help
Thanks

What I have tried:

I'm tried to search in google but i have find a method foreach loop which i cant undersand
Posted
Updated 8-Jan-19 1:50am
v2
Comments
F-ES Sitecore 8-Jan-19 7:36am    
Your question is basically "How do I write a website?" Get a book on asp.net and go through it, or at least look at some "getting started" tutorials on the web and go through those, they will all cover basic things like this. Your question as it stands is unanswerable as we don't know anything about the technology you are using.
Fahim ullah 8-Jan-19 8:22am    
No I want this in window form application
F-ES Sitecore 8-Jan-19 8:34am    
So get a book on writing windows forms or go through getting started tutorials on that. And the question is still unanswerable as we still don't know what database access technology you are using.
RickZeeland 8-Jan-19 15:32pm    
Do you have a particular database in mind, like SQL Server ?

1 solution

You don't want to, not really.
Labels are a poor choice for DB data: a better choice is a data aware control such as a DataGridView (or similar, depending on your environment) which can display multiple rows of data at a time. A Label shows one item only, in its Text property, so multiple columns (StudentID, StudentName,Address, Class, Professor, ...) don't work well, and multiple rows - which is what a DB is all about storing - work even less well.

Stop and think about what your homework asked you to do, and think about the range of controls you have available to you - you will almost certainly find a more appropriate control to use!
 
Share this answer
 
Comments
Fahim ullah 8-Jan-19 8:21am    
Dear Sir, thanks for answering but datagridview cant solve my issue
I want to make a list and from these data and do absent and present using checkbox's I mean Registration Name absent checkbox and present checkbox if a student present I will check present and if absent I will check in absent and don't do this is gridview
OriginalGriff 8-Jan-19 8:30am    
A GridView is exactly what you want to use!
Fahim ullah 8-Jan-19 8:32am    
Can I use the checkbox in Gridview if yes then How?
please help and give some idea
OriginalGriff 8-Jan-19 8:47am    
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search gave nearly half a million hits:
https://www.google.com/search?q=checkbox+in+gridview+c%23&oq=checkbox+in+gridview+c%23&aqs=chrome..69i57j0l5.6993j0j7&sourceid=chrome&ie=UTF-8

In future, please try to do at least basic research yourself, and not waste your time or ours.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900