Challenge of Day

Wednesday, November 4, 2009

ISA (Internet Security and Acceleration) Blocks Outlook's POP3 and SMTP Mail Accounts

Hello,
It is quite possible that your computer resides in a protected network, behind a proxy (MS ISA or Intenet Security and Acceleration) and you want to use our Microsoft Outlook to receive your emails from your POP3 mail server. In this case you might receive error 0x80090040 or 0x80042108 telling you Outlook cannot find your server or cannot connect to your POP3.
To work around this, 3 steps should be done:
1 - Make sure POP3, SMPTP and DNS protocols are open on your ISA. For this you should have an access rule allowing those 3 protocols from INTERNAL NETWORK to EXTERNAL NETWORK.
2 - Open the Microsoft Internet Security and Acceleration Server management console, expand the server name and the expand the Configuration node then click on the General node. In the General node, click on the Define Firewall Client Settings link in the Details pane. In the Firewall Client Settings dialog box, click the Application Settings tab. Pickup Outlook and change Key Value of Disbale to 0

3 - On your local computer, reconfigure your ISA client to refresh its local cache. Make sure firewall client on your computer is enabled as it is responsible to route your requests to ISA server.


Now restart your Outlook and try send or receive again. I assume that you have correct configuration for your email account.

Be a Winner in Your Daily Challenges.

Ali Khademi

Labels: , , , , , ,

Calling Oracle Stored Procedure from VB .NET

Hello,
Calling Oracle Stored Procedure from VB .NET is not something new but since a Don from Cartersville asked me this question, I will explain it here. In general here is the source code to perfome this task:

Public Sub CallOracleStoreProceudre()
Dim conn As New OracleConnection("data source=baridsoft;user id=ali, pwd=khademi")
Try
conn.Open()
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "OracleSP"
Dim p1 As OracleParameter
Dim p2 As OracleParameter

p1 = cmd.Parameters.Add("Param1", OracleType.NVarChar)
p1.Value = "Value1"
p2 = cmd.Parameters.Add("Param2", OracleType.Double)
p2.Value = 10

cmd.ExecuteNonQuery()

Catch ex As Exception
'Handle exceptions here
End Try
conn.close()
End Sub

This VB .NET subroutine calls OracleSP which accepts 2 parameters. It is quite possible to return a result set to calling subroutine. To do so replace the call to
cmd.ExecuteNonQuery with this line:

dim r as new SqlDataReader = cmd.ExecuteReader()

Then you can iterate through your data and process it. (like below)
while r.read
' Do what ever you want
end while


ADO .NET has got wonderfull capabilities when coming to RESTfull data sources. I will cover it sometimes latter.

Here is an example of calling Oracle Stored Function as well:

Public Sub CallOracleStoredFunction()
Dim conn As New OracleConnection("data source=BaridSoft;user id=Ali Khademi;pwd=DoNotAskDoNotTell")
Try
conn.Open()
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "sf_my_function"
Dim p1 As OracleParameter
Dim p2 As OracleParameter
Dim p3 As OracleParameter
Dim p4 As OracleParameter

p1 = cmd.Parameters.Add("param1", OracleType.NVarChar)
p1.Value = "123456"
p2 = cmd.Parameters.Add("param2", OracleType.NVarChar)
p2.Value = "Mn"
p3 = cmd.Parameters.Add("param3", OracleType.Number)
p3.Value = 10
p4 = cmd.Parameters.Add("v", OracleType.Int16)
p4.Direction = ParameterDirection.ReturnValue
Dim n As Integer
n = cmd.ExecuteNonQuery()
MsgBox("Function successfully executed. Return value is " + p4.Value.ToString, MsgBoxStyle.OkOnly, "Function Call")
conn.Close()
Catch ex As Exception
' handle exceptions here
End Try
End Sub



Be a winner in your daily challenges

Ali Khademi