using System.Data.SqlClient; // Create a SqlConnection object SqlConnection connection = new SqlConnection(connectionString); // Open the connection connection.Open(); // Create a SqlCommand object SqlCommand command = new SqlCommand("SELECT MyColumn FROM MyTable", connection); // Execute the command and create a SqlDataReader object SqlDataReader reader = command.ExecuteReader(); // Read the data from the reader while (reader.Read()) { short value = reader.GetInt16(0); Console.WriteLine(value); } // Close the reader and the connection reader.Close(); connection.Close();This example creates a SqlConnection object, opens a connection to a SQL database, creates a SqlCommand object to retrieve data from a table, executes the command and creates a SqlDataReader object, reads the data from the reader using the GetInt16 method, and finally closes the reader and the connection. Package Library: The SqlDataReader class is part of the System.Data.SqlClient namespace in the .NET Framework Class Library. Therefore, no additional package library is required.