How to do Proxy Authentication in SQL Server 2005 ?

By Perry
Access over 40 UI widgets with everything from interactive menus to rich charts.

The following example of Proxy Authentication in SQL Server 2005

Following function does proxy authentication.

Public Shared Function MyFunction(ByVal CardNumber As String) As SqlString

Dim myProxy As New WebProxy("myproxy ip address", portnum)
myProxy.Credentials = New NetworkCredential("myUserName", "myPassword", "myDomain")

Dim strURL As String = "myurl" & CardNumber
Dim Req As WebRequest

Req = WebRequest.Create(strURL)
Req.Proxy = myProxy

Dim Resp As WebResponse
Resp = Req.GetResponse

Dim netStream As StreamReader
netStream = New StreamReader(Resp.GetResponseStream)
Dim strData() As String = Split(netStream.ReadToEnd, "|")

Return New SqlString(strData(1))

End Function


Popularity  (1088 Views)