Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi All
When i Resore .bak File that time Restore failed Error is show.. How to slove this ... Please Tell me..
 
Error is
 
Restore failed for Server 'XX-PC\SQLEXPRESS'.
 
Here i Use code for RESTORE
 
<pre lang="vb">Dim res As New Restore()
 
        Me.Cursor = Cursors.WaitCursor
        Me.DGV1.DataSource = String.Empty
 
    Dim fileName As String = Me.txtFileName.Text
    Dim databaseName As String = Me.ddlDatabase.SelectedItem.ToString()
 
        res.Database = databaseName
        res.Action = RestoreActionType.Database
        res.Devices.AddDevice(fileName, DeviceType.File)
        res.ReplaceDatabase = False
        res.NoRecovery = True
       res.PercentCompleteNotification = 10
        res.SqlRestore(srv)
      MessageBox.Show("Restore of " & databaseName & " Complete!", "Restore"
, MessageBoxButtons.OK, MessageBoxIcon.Information)
Posted 20-Apr-13 9:49am
Comments
Idle_Force at 20-Apr-13 21:13pm
   
Did you Try/Catch your code and check the entire error for more info? Inner exception, stack trace, etc...
Navas Khanj at 21-Apr-13 2:12am
   
not try Catch
Dave Kreskowiak at 21-Apr-13 10:17am
   
It's impossible for anyone to help you becuase the "Restore" class is not a .NET class or a mamber of any library I'm familiar with. Without seeing what that Restore class code is doing and the exact error message it's throwing, it's impossible to help.
 
If this is a 3rd party library you're using, youre best source of information about how to use it would be the people who wrote it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Marcin Kozub 310
1 OriginalGriff 248
2 Sergey Alexandrovich Kryukov 215
3 Richard MacCutchan 202
4 Praneet Nadkar 197
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100