TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jyoti Jodha
NA
1.7k
408.5k
How to retrieve data from database to radio button
Nov 17 2017 1:28 AM
How to retrieve data from database to radiobutton in Windows Form C#
I saved radiobutton value in database like "A4Size" or "A5Size".Now i want to retrieve that data from database to radiobutton.If A4Size in database i want to check the Radionbutton (A4Size) value other wise uncheck the radiobutton (A5Size) value.
Code Like this
private void BillLoad()
{
DataTable dt = new DataTable();
con.Open();
SqlDataReader myReader = null;
SqlCommand myCommand = new SqlCommand("select * from Bill ", con);
myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
if (myReader["ReportSize"].ToString() == "A4_Size")
{
ChhkA4.Checked = true;
}
else
{
ChhkA5.Checked = true;
}
}
con.Close();
}
Reply
Answers (
5
)
display data present struct to richtextbox
Windows Forms application