Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
diplay data from Mysql table line after line in a label
Inaam Hammouda
Apr 24 2016 7:37 AM
339
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Advance JSON deserialize > SQL Insert
table in c#