I get a row from table and some field of this row are null
. How can I get these fields with SqlDataReader
?
//so_type , so_read are null able
while (reader.Read())
{
s.id = (Int64)reader["so_id"];
s.senderid = (Int64)reader["so_senderid"];
s.body = (string)reader["so_body"];
s.date = (string)reader["so_date"];
s.isread = (bool)reader["so_read"];
s.type = (int)reader["so_type"];
}