COPIAR TABELAS ENTRE PROVEDORES DE DADOS DIFERENTS

HELDER 26/01/2013 09:07:52
#418150
Boas

Como posso copiar tabelas entre SQL Server e (SQL CE ou SQLite) ?

HELDER 29/01/2013 07:42:36
#418279
Tentei assim:
  Imports System.Data.SqlClient
Imports System.Data.SqlServerCe

Public Class Form1
Dim connectionstring = [Ô]Data Source=HELDER-PC\QUINTAS;Initial Catalog=Expo;Integrated Security=SSPI;[Ô]
Dim connectionstring_destino = [Ô]Data Source=[ô]C:\Users\Helder\Desktop\Expo.sdf[ô];[Ô]
Private da As SqlCeDataAdapter

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim origem As SqlConnection = New SqlConnection(connectionstring)
Dim destino As SqlCeConnection = New SqlCeConnection(connectionstring_destino)
Dim da_origem As SqlDataAdapter
Dim ds_origem As DataSet
Dim da_destino As New SqlCeDataAdapter
Dim ds_destino As New DataSet
Dim dt_origem As New DataTable
Dim dt_destino As New DataTable
origem.Open()
destino.Open()

Dim sql As String = [Ô]Select * from dbo.Tabela[Ô]


da_origem = New SqlDataAdapter(sql, origem)

ds_origem = New DataSet

da_origem.Fill(dt_origem)
dt_destino = dt_origem.Copy

Me.DataGridView1.DataSource = dt_destino

Dim cb As New SqlCeCommandBuilder(da_destino)
da_destino.Update(ds_destino, [Ô]dbo.Tabela[Ô]) [ô] ERRO AQUI
destino.Close()
origem.Close()
MsgBox([Ô]ok[Ô])
End Sub
End Class


Criei as 2 tabelas de origem e de destino iguais, mas não dá
Faça seu login para responder