/*! \fn List<Book> read_book(string value) * \brief A reading data function. * \details It is used to read data from book table in database. * \param value (string) table name. * \return List<Book> */ public List <Book> read_book(string value) { Book b = new Book(0, null, 0, 0, null, null, 0, null, null, 0); b.setTotalBook(1); BookList.Clear(); using (connection = new SQLiteConnection(path)) { connection.Open(); string stm = "SELECT * FROM " + value; using (sql_command = new SQLiteCommand(stm, connection)) { using (SQLiteDataReader sdr = sql_command.ExecuteReader()) { while (sdr.Read()) { Book mybook = new Book(sdr.GetInt32(0), sdr.GetString(1), sdr.GetDouble(2), sdr.GetInt32(4), sdr.GetString(5), sdr.GetString(6), sdr.GetInt32(7), null, sdr.GetString(8), sdr.GetInt32(9)); BookList.Add(mybook); } sdr.Close(); connection.Close(); } } connection.Close(); } return(BookList); }