Tacno, nije isto, sto nas vraca na tvoj odgovor, posle komande:
int var=Convert.ToInt32(null)
var ce biti 0, ne null

. Sta vise, kad vrsis upit nad poljem u DataRow, ako je polje u bazi NULL, vrednost polja nece biti null, nego DBNull.Value, a ako pokusas da izvrsis
int var=Convert.ToInt32(DBNull.Value)
dobices:
Object cannot be cast from DBNull to other types.
bas da bi se sprecilo da se NULL iz baze u kodu tretira kao 0.
Jedna od zaobilaznica je da promenljivu var deklarises kao object i da "boxujes" integer u nju i da imas neku konstrukciju nalik ovoj:
object var;
if (dr["Polje"] is DBNull)
var = null;
else
var = Convert.ToInt32(dr["Polje"]);
ali onda ne mozes da se zatrcis pa da koristis var kao integer bez da proveravas da li je null
▪ "Why isn't my wireless mouse connected to the computer?" - 2008 Dumbest Technical Support Question award
▪ The word 'politics' is derived from the word 'poly', meaning 'many', and the word 'ticks', meaning 'blood sucking parasites' - Larry Hardiman
▪ If the good guy gets the girl, it's rated PG; if the bad guy gets the girl, it's rated R; and if everybody gets the girl, it's rated X