23-02-16, 03:25 PM
جرب هذا الكود
PHP كود :
Public Shared Sub TransportTable(ByVal sourceDbPath As String, ByVal targetDbPath As String, ByVal lstTables As List(Of String))
Dim constr As String = ((Convert.ToString("Provider=Microsoft.JET.OLEDB.4.0;data source=") & targetDbPath) + ";Persist Security Info=False;")
Dim conn = New OleDbConnection(constr)
Dim yescommander = New OleDbCommand()
conn.Open()
lstTables.ForEach(Sub(tableName As [String])
yescommander.CommandType = CommandType.Text
yescommander.Connection = conn
yescommander.CommandText = (Convert.ToString("SELECT f.* INTO " + tableName + " FROM " + tableName + " AS f IN '") & sourceDbPath) + "';"
Dim result As Integer = yescommander.ExecuteNonQuery()
End Sub)
conn.Close()
End Sub
Don't Be The Perfect one
be the right one

