private void button3_Click(object sender, EventArgs e) { ContentTextDto ctext = new ContentTextDto(); ctext.BookID = Convert.ToInt64(cmbBook.SelectedValue.ToString()); try { ctext.ChapterID = Convert.ToInt64(cmbChapter.SelectedValue.ToString()); } catch (Exception) { MessageBox.Show("Select Book Name", "Book Name not selected", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } //uncomplete join is not needed //This query is used for only projecet show join and sub query //Original query is not Same and no complex string sql = "select tblContentText.content as ContentText from tblContentText join tblChapter " + "on tblChapter.ChapterID=tblContentText.ChapterID and " + "tblContentText.BookId in(select tblBook.BookID from tblBook join tblChapter " + "on tblBook.BookID=tblChapter.BookId and tblBook.BookID=" + Convert.ToInt64(cmbBook.SelectedValue) + ");"; string s = ""; // MessageBox.Show(sql); list = ExtrafaltuClass.FaltuqueryForfrmBookReader(sql); if (list.Count >= 0) { lblBookName.Text = "Book Name : " + this.cmbBook.GetItemText(this.cmbBook.SelectedItem); lblChapter.Text = "Chapter Name : " + this.cmbChapter.GetItemText(this.cmbChapter.SelectedItem); try { rtxtContent.Text = list[countChapter]; countChapter++; } catch (Exception) { MessageBox.Show("Chapter not founf", "Not found", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }
private void button3_Click(object sender, EventArgs e) { int s = ExtrafaltuClass.MinEx(); MessageBox.Show(s + ""); }