Server Error in '/' Application.

Index was outside the bounds of the array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:


Line 322:        int schoolid = GetID(shortname, Keys.School, 0);
Line 323:        string[] fullname = name.Replace("/","").Split('_');
Line 324:        string sqlstring = "SELECT TOP 1 player_id FROM tbl_Players LEFT JOIN tbl_Schools ON tbl_schools.school_id = tbl_Players.school_id WHERE tbl_Players.name LIKE '" + fullname[1].Replace("-", "''").Replace(",", ".") + "' AND firstname LIKE '" + fullname[0].Replace("-", "''").Replace(",", ".") + "' AND tbl_Players.school_id = '" + schoolid + "' AND tbl_players.status = '1' AND player_id IN (SELECT player_id FROM tbl_Roster LEFT JOIN tbl_Teams ON tbl_Teams.team_id = tbl_Roster.team_id WHERE school_id = '" + schoolid + "' AND sport_id = '" + sport + "' )";
Line 325:
Line 326:        DataSet ds = ReturnDataSet(sqlstring, "Player");

Source File: e:\webs\varsity.the570.com\App_Code\DataLayer.cs    Line: 324

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   DataLayer.GetPlayerID(String name, String shortname, Int32 sport) in e:\webs\varsity.the570.com\App_Code\DataLayer.cs:324
   school.Page_PreRender(Object sender, EventArgs e) in e:\webs\varsity.the570.com\school.aspx.cs:100
   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.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +11160622
   System.Web.UI.Control.PreRenderRecursiveInternal() +108
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8974