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
Inaam Hammouda
NA
42
6.9k
diplay data from Mysql table line after line in a label
Apr 24 2016 7:37 AM
hi ,
i want to read and display data from Mysql table into a label in my winform app.
i tried this :
string sql = "SELECT vitesse FROM val_api;";
MySqlDataAdapter da = new MySqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count == 0)
{
MessageBox.Show(this,"No data found.", "No Data");
}
else
{
foreach (DataRow dr in dt.Rows)
{
vitesseVal.Text = dr[0] + "";
break;
}
}
}
but it only shows the first row only
any help ,please
Reply
Answers (
3
)
Advance JSON deserialize > SQL Insert
table in c#