M
Michel Vanderbeke
Hello,
Thank you for your help.
When I browse the internet, I only find examples on how to restore an entire
database.
What I try to achieve is to replace only one or several tables in the
database by updated tables from another database.
I added the reference to Microsoft.SqlServer.Smo and to
Microsoft.sqlServer.ConnectionInfo to my project.
In an example, I found following code:
Dim svr As Server = New Server() '
Dim res As Restore = New Restore()
res.DeviceType = DeviceType.File
===> this line gives an ERROR: DeviceType is not a member of
Microsoft.SqlServer.Management.Smo.Restore
res.Devices.Add("C:\Kassasysteem\Kassasysteem.mdf")
===> this line gives an ERROR: Value of type 'String' cannot be converted
to Microsoft.SqlServer.Management.Smo.BackupDeviceItem
res.Database = "Kassasysteem"
res.ReplaceDatabase = True
res.PercentCompleteNotification = 10
AddHandler res.PercentComplete, AddressOf ProgressEventHandler
res.SqlRestore(svr)
Can you please help me to fix this errors and explain to me how I can
restore only a few tables from a database and not the entire database?
Many thanks,
Michel
Thank you for your help.
When I browse the internet, I only find examples on how to restore an entire
database.
What I try to achieve is to replace only one or several tables in the
database by updated tables from another database.
I added the reference to Microsoft.SqlServer.Smo and to
Microsoft.sqlServer.ConnectionInfo to my project.
In an example, I found following code:
Dim svr As Server = New Server() '
Dim res As Restore = New Restore()
res.DeviceType = DeviceType.File
===> this line gives an ERROR: DeviceType is not a member of
Microsoft.SqlServer.Management.Smo.Restore
res.Devices.Add("C:\Kassasysteem\Kassasysteem.mdf")
===> this line gives an ERROR: Value of type 'String' cannot be converted
to Microsoft.SqlServer.Management.Smo.BackupDeviceItem
res.Database = "Kassasysteem"
res.ReplaceDatabase = True
res.PercentCompleteNotification = 10
AddHandler res.PercentComplete, AddressOf ProgressEventHandler
res.SqlRestore(svr)
Can you please help me to fix this errors and explain to me how I can
restore only a few tables from a database and not the entire database?
Many thanks,
Michel