Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 26th, 2012  |  syntax: VB.NET  |  size: 0.96 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Using cnn As New MySqlConnection("server=..;user id=..;password=...;database=..;")
  2.             Dim cmdSelect As MySqlCommand = New MySqlCommand("Select * from `" + table + "`")
  3.             cmdSelect.Connection = cnn
  4.             Dim ad As New MySqlDataAdapter(cmdSelect)
  5.             ad.AcceptChangesDuringFill = False
  6.             ad.Fill(dt)
  7.         End Using
  8.  
  9.         Using cnn As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;Data Source=D:\...")
  10.             Dim cmdSelect As OleDbCommand = New OleDbCommand("Select * from `" + table + "`")
  11.             cmdSelect.Connection = cnn
  12.             Dim ad As New OleDbDataAdapter(cmdSelect)
  13.             Dim cmdBuilder As New OleDbCommandBuilder(ad)
  14.             cmdBuilder.QuotePrefix = "["
  15.             cmdBuilder.QuoteSuffix = "]"
  16.             Dim cmd As OleDbCommand = cmdBuilder.GetInsertCommand()
  17.             cmd.Connection = cnn
  18.  
  19.             ad.InsertCommand = cmd
  20.             ad.Update(dt)
  21.         End Using