Exemple #1
0
        public DataSet GetData(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");
            bookList = new ArrayList();
            DataSet ds = new DataSet();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Book WHERE " + item.ToString() + "='" + str + "'";
                SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, conn);
                adapter.Fill(ds);
            }
            return ds;
        }
Exemple #2
0
        public DataSet GetData(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");

            bookList = new ArrayList();
            DataSet ds = new DataSet();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string            sql     = "SELECT * FROM Book WHERE " + item.ToString() + "='" + str + "'";
                SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, conn);
                adapter.Fill(ds);
            }
            return(ds);
        }
Exemple #3
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");

            bookList = new ArrayList();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Book WHERE " + item.ToString() + "=" + str + "";

                SQLiteCommand    cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    bookData.author = rdr["author"].ToString();
                    bookData.title  = rdr["title"].ToString();
                    bookList.Add(bookData);
                }
                rdr.Close();
            }
            return(bookList);
        }
Exemple #4
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");
            bookList = new ArrayList();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Book WHERE " + item.ToString() + "=" + str + "";

                SQLiteCommand cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    bookData.author = rdr["author"].ToString();
                    bookData.title = rdr["title"].ToString();
                    bookList.Add(bookData);
                }
                rdr.Close();
            }
            return bookList;
        }