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);
}
독자가 당신이 당신의 SQL 쿼리가있다리더 MySQL은 반환 유지 널
command.CommandText = "SELECT idtolistsubsoorten FROM `vogelsoort` WHERE id= MAX (id) and vogelsoort.naam [email protected]";
idtolistsubsoorten이 실제로 null 일 가능성을 조사 했습니까? – e4c5