MySqlConnection con = new MySqlConnection("host=db4free.net;user=*;password=*;database=*;");
MySqlCommand xcmd = new MySqlCommand("SELECT x FROM members WHERE id='" + Login.idd + "';");
xcmd.Connection = con;
xint.Connection = con;
DataTable dt = new DataTable();
con.Open();
xcmd.ExecuteNonQuery();
int xx = (int)xcmd.ExecuteScalar();
xcmd.Connection.Close();;
xcmd.Dispose();
x = xx;
con.Close();
if (x == 2)
{
button6.BackgroundImage = Properties.Resources.logo;
}
我希望程序从数据库中读取 X 的值,将其添加到变量中,然后如果它等于 2 则显示徽标...