I'm trying to pull data using a SqlDataReader, one column of which is in datetime. I'd like to do something like this
SqlCommand command = new SqlCommand("SELECT * FROM table", connection); //connection is defined earlier
SqlDataReader data = command.ExecuteReader();
while(data.Read()){
DateTime birthday = data["Birth"];
list.Add(birthday);
}
}
Can I do this? Or does SqlDataReader return strings, in which case I'd have to create a new DateTime object using that string?
Thanks, -S