Index was outside the bounds of the array (500th?)
<p>Calling the function on load and the error is pointing to that. I don't get the index out of range error on debug only on publish.</p>

<pre><code>    {
        string strLogonUser = Request.ServerVariables["LOGON_USER"];
        var credential = strLogonUser.Split(@"\".ToCharArray())[1];




        cnn.Open();
        SqlTransaction tran = cnn.BeginTransaction();
        cmd.Connection = cnn;
        cmd.Transaction = tran;
        cmd.CommandText = "StoredProcedure";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("@UserLogin", SqlDbType.NVarChar).Value = credential;
        cmd.ExecuteNonQuery();


    }




    [IndexOutOfRangeException: Index was outside the bounds of the array.]
   _Default.ReadUser() +357
   _Default.Page_Load(Object sender, EventArgs e) +46
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
</code></pre>
