i got that code to save dataset to from table to another table
vb Code:
Private Sub Option1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Option1ToolStripMenuItem.Click Try Dim SavInto As New OleDb.OleDbCommand SavInto.Connection = CON SavInto.CommandType = CommandType.Text SavInto.CommandText = "INSERT INTO versecollection (BookNum,ChapterNum,VerseNum)" & _ "SELECT Bible.BookNum, Bible.ChapterNum, Bible.VerseNum FROM BibleBookNames INNER JOIN Bible ON BibleBookNames.BookNum = Bible.BookNum WHERE (((BibleBookNames.Book)=""" & DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(0).Value.ToString & """) AND ((Bible.ChapterNum)= " & ComboBox2.Text & ") AND ((Bible.VerseNum)=" & DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(1).Value.ToString & "))" CON.Open() SavInto.ExecuteNonQuery() CON.Close() Catch ex As Exception MsgBox(ex.Message) End Try
i need to know some thing if i want this option to work with any datagridview because i have more than one datagridview in my application how to make that code or optin or the SQL statment work on all the datagridview not only DataGridView1




Reply With Quote