V
Vanessa
Hi,
I'm using SQL Server 2000 as my database and I'm trying to backup the database through the software using SQL statement.
One of my Client experienced an error,
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. System.Data.SqlClient.sqlexception: Timeout Expired: the timeout period elapsed prior to Completion of the operation or the server is not responding....
The Backup operation is done halfway then the system will throw out this error.
Among my Clients, only One experienced this, I do not know why this happen. Does any know? How can I solve this? My Procedure for Backup is I called my Backup from PerformLocalBackup,creating all the necessary device.
Public Sub PerformLocalBackup(ByVal filePathOnDBServer As String, ByVal dbCatalog As String)
'Drop Existing Backup Device
If (DeviceExists()) Then
DropDevice()
End If
'Create Backup Device
CreateNewDevice(filePathOnDBServer)
'Process Backup
BackupDatabase(dbCatalog)
VerifyDeviceFile()
'Drop Backup Device
DropDevice()
End Sub
Public Sub BackupDatabase(ByVal databaseName As String)
Dim myCMD As New SqlCommand
myCMD.Connection = my_SqlConnection
myCMD.CommandType = CommandType.Text
Try
myCMD.Connection.Open()
myCMD.CommandText = "USE MASTER BACKUP DATABASE " & databaseName & " TO myCASDevice WITH INIT"
Console.WriteLine(myCMD.CommandText)
myCMD.ExecuteNonQuery()
Catch ex As Exception
Throw ex
Finally
myCMD.Connection.Close()
End Try
End Sub
Please Help.
Regards
Vanessa
I'm using SQL Server 2000 as my database and I'm trying to backup the database through the software using SQL statement.
One of my Client experienced an error,
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. System.Data.SqlClient.sqlexception: Timeout Expired: the timeout period elapsed prior to Completion of the operation or the server is not responding....
The Backup operation is done halfway then the system will throw out this error.
Among my Clients, only One experienced this, I do not know why this happen. Does any know? How can I solve this? My Procedure for Backup is I called my Backup from PerformLocalBackup,creating all the necessary device.
Public Sub PerformLocalBackup(ByVal filePathOnDBServer As String, ByVal dbCatalog As String)
'Drop Existing Backup Device
If (DeviceExists()) Then
DropDevice()
End If
'Create Backup Device
CreateNewDevice(filePathOnDBServer)
'Process Backup
BackupDatabase(dbCatalog)
VerifyDeviceFile()
'Drop Backup Device
DropDevice()
End Sub
Public Sub BackupDatabase(ByVal databaseName As String)
Dim myCMD As New SqlCommand
myCMD.Connection = my_SqlConnection
myCMD.CommandType = CommandType.Text
Try
myCMD.Connection.Open()
myCMD.CommandText = "USE MASTER BACKUP DATABASE " & databaseName & " TO myCASDevice WITH INIT"
Console.WriteLine(myCMD.CommandText)
myCMD.ExecuteNonQuery()
Catch ex As Exception
Throw ex
Finally
myCMD.Connection.Close()
End Try
End Sub
Please Help.
Regards
Vanessa