public RetrieveBooks RetrieveAll()
        {
            RetrieveBooks books = new RetrieveBooks();

            GetDBConnection();
            conn.Open();
            DataSet        ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter("Select * from BookInfo", conn);

            da.Fill(ds);
            books.BookSet = ds;
            conn.Close();
            return(books);
        }
        public RetrieveBooks RetrieveByAuthor(string author)
        {
            RetrieveBooks books = new RetrieveBooks();

            GetDBConnection();
            conn.Open();
            string     cmdTxt = "SELECT * FROM BookInfo WHERE AuthorList LIKE @author";
            SqlCommand cmd    = new SqlCommand(cmdTxt, conn);

            cmd.Parameters.AddWithValue("@author", "%" + author + "%");
            DataSet        bookDataSet = new DataSet();
            SqlDataAdapter da          = new SqlDataAdapter(cmd);

            da.Fill(bookDataSet);
            books.BookSet = bookDataSet;
            conn.Close();
            return(books);
        }
        public RetrieveBooks RetrieveByPrice(float price)
        {
            RetrieveBooks books = new RetrieveBooks();

            GetDBConnection();
            conn.Open();
            string     cmdTxt = "SELECT * FROM BookInfo WHERE Price >  @price";
            SqlCommand cmd    = new SqlCommand(cmdTxt, conn);

            cmd.Parameters.AddWithValue("@price", price);
            DataSet        bookDataSet = new DataSet();
            SqlDataAdapter da          = new SqlDataAdapter(cmd);

            da.Fill(bookDataSet);
            books.BookSet = bookDataSet;
            conn.Close();
            return(books);
        }
        public RetrieveBooks RetrieveByDate(string date)
        {
            RetrieveBooks books = new RetrieveBooks();

            GetDBConnection();
            conn.Open();
            string     formattedDate = DateTime.Parse(date).ToString("yyyy-dd-MM");
            string     cmdTxt        = "SELECT * FROM BookInfo WHERE PublishingDate > @date";
            SqlCommand cmd           = new SqlCommand(cmdTxt, conn);

            cmd.Parameters.AddWithValue("@date", formattedDate);
            DataSet        bookDataSet = new DataSet();
            SqlDataAdapter da          = new SqlDataAdapter(cmd);

            da.Fill(bookDataSet);
            books.BookSet = bookDataSet;
            conn.Close();
            return(books);
        }