前几天用过,没有细究,现有时间简单整理流程
using (MySqlConnection conn = new MySqlConnection(strConn))
{
conn.Open();
using (MySqlCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT id,name from t_file where file_name = xxx'";
using (MySqlDataAdapter da = new MySqlDataAdapter(cmd))
{
da.Fill(ds);
}
}
}
MessageBox.Show(ds.Tables[0].Rows[0][0] + "");