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

Francis SusaimichaelRank #466 · 5.4K reputationPosted Apr 24, 2016, 5:08 AM EDT
Inaam Hammouda42 reputationPosted Apr 24, 2016, 6:12 AM EDT
Francis SusaimichaelRank #466 · 5.4K reputationPosted Apr 27, 2016, 11:23 AM EDT