Connection Timeout Expire after set connection.ConnectTimeout = 0


I have database with 22.5 GB size. My database is filestream enable database. My database mdf and ldf file size is 113 MB but my file stream data folder is 22 gb size. I take backup using following code and I get connection time out error..

Dim connection As New ServerConnection(sqlInstanceName, "sa", pwd)
Dim srv As Server
srv = New Server(connection)
connection.ConnectTimeout = 0
Dim db As Database
db = srv.Databases(DBName)
Dim recoverymod As Integer
recoverymod = db.DatabaseOptions.RecoveryModel
bk.Action = BackupActionType.Database
bk.Database = DBName
Dim str As String
str = full_path & ".bak"
Dim bdi As BackupDeviceItem
bdi = New BackupDeviceItem(str, DeviceType.File)
bk.Incremental = False

But after executing this it gives me error as following

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The backup or restore was aborted.
Processed 65328 pages for database 'abc', file 'abc' on file 1.
10 percent processed.
20 percent processed.
30 percent processed.
40 percent processed.
50 percent processed.
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)

It works fine on small size database.. But not work on this 13 GB database.. I continuously see the backup file size. It created up to 8 GB but when after 8 GB it vanished. I have file stream enable database.

What is the problem after set connection timeout to 0?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!