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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Increase timeout on VB.NET script task
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

qman
Constraint Violating Yak Guru

USA
442 Posts

Posted - 03/12/2015 :  11:52:26  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

2780 Posts

Posted - 03/12/2015 :  12:23:00  Show Profile  Reply with Quote
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

USA
442 Posts

Posted - 03/12/2015 :  13:01:48  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000