Advertisement
Guest User

Untitled

a guest
Sep 26th, 2012
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.96 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement