Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Increase timeout on VB.NET script task

Author  Topic 

qman
Constraint Violating Yak Guru

442 Posts

Posted - 2015-03-12 : 11:52:26
Hello, I am trying to increase the timeout on a VB.NET script task to 5 minutes. The code below calls a simple web service via the task.

Could someone help me out?


Imports System
Imports System.Data
Imports System.Math
Imports System.Collections.Generic
Imports System.Net
Imports System.Net.Security
Imports System.Text
Imports System.Web.Script.Serialization
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain
Public Sub Main()
Dim url As String = "http://url.com"
Dim userName As String = "test"
Dim password As String = "test"
Dim crmContactsWebClient As New WebClient()
Dim httpCredentialCache As New CredentialCache()
Dim basicNetworkCredential As New NetworkCredential(userName, password)
httpCredentialCache.Add(New Uri(url), "Basic", basicNetworkCredential)
crmContactsWebClient.Credentials = httpCredentialCache
Dim postData(0) As Byte
Dim responseData() As Byte = crmContactsWebClient.UploadData(url, postData)
Dim response As String = Encoding.UTF8.GetString(responseData)
Dim jsonJavaScriptSerializer As New JavaScriptSerializer()
Dim responseJSON As Dictionary(Of String, Object) = jsonJavaScriptSerializer.Deserialize(Of Dictionary(Of String, Object))(response)
Dts.TaskResult = Dts.Results.Success
End Sub
End Class

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-12 : 12:23:00
This doesn't look like an SSIS question!

Anyway, check this out: http://www.codeproject.com/Tips/69637/Setting-timeout-property-for-System-Net-WebClient

It's C# but should be easily translatable to VB
Go to Top of Page

qman
Constraint Violating Yak Guru

442 Posts

Posted - 2015-03-12 : 13:01:48
Thanks, I will check out the link. I did not know if there was something that could have been set on the Script Task properties. Similar to the timeout field on a SQL Data Connection.

Appreciate the help though.
Go to Top of Page
   

- Advertisement -