>public class ScrapDB > { > public sqldatareader UsersReader > > public static SqlConnection GetConnection() > { > string connectionString = ConfigurationSettings.AppSettings["connectionString"]; > > return new SqlConnection(connectionString); > > } > > public static SqlDataReader GetUsers() > { > // Use a SqlDataReader to fill ddlUsers... > SqlDataReader UsersReader = null ; > > SqlConnection UsersConnection = GetConnection() ; > > string selectStatement = "SELECT UserID " > + "FROM UserInfo "; > > SqlCommand selectCommand = new SqlCommand(selectStatement, UsersConnection); > //SqlDataReader UsersReader; > > UsersConnection.Open(); > UsersReader = selectCommand.ExecuteReader(CommandBehavior.CloseConnection); > UsersReader.Read() ; > return UsersReader ; > > > > > > } > public static CloseReader() > { > UsersReader.Close() ; > > } > >} > > > > >