try
{
string strConnection = "host=bla; database=twhalen_storage; username=twhalen_software; password=bla!;";
MySqlConnection conSQL = new MySqlConnection(strConnection);
MySqlCommand mycommand = new MySqlCommand("SELECT * FROM twhalen_storage.users WHERE username= '" + this.username_txt.Text + "'AND password= '" + this.password_txt.Text + "';", conSQL);
MySqlDataReader myReader;
conSQL.Open();
myReader = mycommand.ExecuteReader();
int count = 0;
while (myReader.Read())
{
count = count + 1;
}
if (count == 1)
{
this.Hide();
Form2 f2 = new Form2();
f2.ShowDialog();
}
else
MessageBox.Show("go away");
conSQL.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
如何使用与此类似的代码执行多个mysql查询?