Beispiel #1
0
        private static SqlDataReader _GetDataReaderByQuery(string connectionString)
        {
            SqlDataReader dr;

            using (DataBroker db = new DataBroker(connectionString))
            {
                dr = db.GetDataReader("Select * from [dbo].[things]");
            }

            return(dr);
        }
Beispiel #2
0
        private static SqlDataReader _GetDataReaderBySP(string connectionString)
        {
            SqlDataReader reader;

            using (DataBroker db = new DataBroker(connectionString))
            {
                List <SqlParameter> sqlParams = new List <SqlParameter>();

                sqlParams.Add(new SqlParameter {
                    ParameterName = "@thingId", Value = "1"
                });

                reader = db.GetDataReader("[dbo].[usp_GetThings]", sqlParams, CommandType.StoredProcedure);
            }

            return(reader);
        }