Results 1 to 3 of 3

Thread: [RESOLVED] Help about save dataset

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2009
    Posts
    534

    Resolved [RESOLVED] Help about save dataset

    i got that code to save dataset to from table to another table

    vb Code:
    1. Private Sub Option1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Option1ToolStripMenuItem.Click
    2.         Try
    3.             Dim SavInto As New OleDb.OleDbCommand
    4.             SavInto.Connection = CON
    5.             SavInto.CommandType = CommandType.Text
    6.             SavInto.CommandText = "INSERT INTO versecollection (BookNum,ChapterNum,VerseNum)" & _
    7.             "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 & "))"
    8.             CON.Open()
    9.             SavInto.ExecuteNonQuery()
    10.             CON.Close()
    11.         Catch ex As Exception
    12.             MsgBox(ex.Message)
    13.         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

  2. #2
    Junior Member
    Join Date
    May 2007
    Posts
    23

    Re: Help about save dataset

    you may use SqlDataAdapter then set those Select,Insert,Update,Delete command properties

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2009
    Posts
    534

    Re: Help about save dataset

    i dont get your point

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width