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; }
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); }
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); }
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; }