Answers for "SqlDataReader to string list"

0

SqlDataReader to string list

List<string> result = new List<string>();
using (conn)
{
    conn.Open();
    using (SqlDataReader reader = command.ExecuteReader())
    {
        while(reader.Read())
        {
            result.Add(Convert.ToString(reader["Health Insurance NO"]));
        }
    }
}
Posted by: Guest on August-25-2021

Browse Popular Code Answers by Language