MySqlCommand command = new MySqlCommand(selectCmd, myConnection);
command.CommandText = "SELECT idtolistsubsoorten FROM `vogelsoort` WHERE id= MAX (id)and vogelsoort.naam [email protected]";
command.Parameters.Add("@vogelsoortnaam", MySqlDbType.VarChar).Value = vogel.Soortnaam;
reader = command.ExecuteReader();
reader.Read();
while (reader.Read())
{
string idpape = reader.;
subid = Convert.ToInt64(idpape);
}
讀者不斷返回一個空值讀者MySQL總是返回null
你是否調查過idtolistsubsoorten可能真的爲空的可能性? – e4c5