|
-
Apr 15th, 2010, 12:22 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Help about save dataset
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
-
Apr 15th, 2010, 03:44 PM
#2
Junior Member
Re: Help about save dataset
you may use SqlDataAdapter then set those Select,Insert,Update,Delete command properties
-
Apr 15th, 2010, 04:16 PM
#3
Thread Starter
Fanatic Member
Re: Help about save dataset
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|