private void btnSearch_Click(object sender, EventArgs e) { string text = txtSearch.Text; string version = cbNIV.Checked ? "NIV" : ""; version = cbCUV.Checked ? "CUV" : "NIV"; List <string> bible = Bibles.getScripture(version, text); int n = bible.Count; for (int i = 0; i < n; i++) { lstSearch.Text += bible[i] + "\n"; } }
private void btngo_Click(object sender, EventArgs e) {/* * const string filename = @"C:\Users\zhang\source\repos\Bible1\SqliteDataAcc\content\NIV.db"; * const string sql = "select * from books;"; * var conn = new SQLiteConnection("Data Source=" + filename + ";Version=3;"); * try * { * conn.Open(); * DataSet ds = new DataSet(); * var da = new SQLiteDataAdapter(sql, conn); * da.Fill(ds); * grid.DataSource = ds.Tables[0].DefaultView; * } * catch (Exception) * { * throw; * }*/ //string text = txtSearch.Text; string version = cbNIV.Checked ? "NIV" : ""; version = cbCUV.Checked ? "CUV" : "NIV"; grid.DataSource = Bibles.getScripture(version, "Eph", 2); }