public Kupac(SqlDataReader reader)
{
KupacId = Convert.ToInt32(reader[\"KupacId\"]);
Ime = reader[\"Ime\"].ToString();
Prezime = reader[\"Prezime\"].ToSt
what Smith.h.Neil said, but I would use the other version of try parse if the value could be an invalid date.
string validDate = "2014-04-17";
string invalidDate = "not a date";
DateTime date;
DateTime date2;
bool isValidDate = DateTime.TryParse(validDate, out date);
bool isValidDate2 = DateTime.TryParse(invalidDate , out date2);
http://msdn.microsoft.com/en-us/library/system.datetime.aspx
Assuming ClanOd is a DateTime Replace
ClanOd = (DateTime)reader["ClanOd"];
With
DateTime date;
bool isValid = DateTime.TryParse(reader["ClanOd"].ToString(), out date);
if(isValid)
ClanOd = date;