OracleConnection connection = DBHelper.OracleConnection;
OracleCommand OraCommand = connection.CreateCommand();
OraCommand.CommandText = "AUTHENTICATION.Authenticate";
OraCommand.CommandType = CommandType.StoredProcedure;
int zero = 0;
OracleParameter newParam = null;
OraCommand.Parameters.Add(newParam);
newParam = new OracleParameter("Authenticated", OracleType.VarChar);
newParam.Direction = ParameterDirection.Output;
newParam.Size = 4000;
OraCommand.Parameters.Add(newParam);
newParam = new OracleParameter("Message", OracleType.VarChar);
newParam.Direction = ParameterDirection.Output;
newParam.Size = 4000;
OraCommand.Parameters.Add(newParam);
newParam = new OracleParameter("Response", OracleType.VarChar);
newParam.Direction = ParameterDirection.Output;
newParam.Size = 4000;
OraCommand.Parameters.Add(newParam);
try
{
connection.Open();
OraCommand.ExecuteNonQuery();
connection.Close();
errorLabel.Text = OraCommand.Parameters["Message"].Value.ToString() ;
if (OraCommand.Parameters["Authenticated"].Value.ToString() == "Yes")
{
this.Response.Redirect("Default.aspx", true);
}else
{
errorLabel.Text = OraCommand.Parameters["Message"].Value.ToString() + Request.ServerVariables["SERVER_SOFTWARE"] + OraCommand.Parameters[9].Value.ToString();
}
}
catch (Exception ex)
{
errorLabel.Text = ex.ToString();
}
Expected outputs:
1) Message - You have successfully logged in
but I'm getting a truncated string: You have success
2) Authenticated - Yes
but I'm getting a truncated string
Y
Same code worked fine in IIS 7.5, we upgraded our server to IIS 8.5 now I'm facing this problem .
I did read some articles about ado.net deprecated and use odp.net . I dont want to change my code to ODP.net .
Do you have any thoughts , why my output variables are truncated ??
When we upgraded IIS 8.5 we installed 12.1.0 instant client on that machine. Does this cause the problem ???