System.IndexOutOfRangeException: Index was outside the bounds of the array. At WinServiceProject.WinService.OnStart(String[] args) in C:\Documents and Settings\Administrator\Desktop\WinServiceProject\WinService.cs:line 515
{
string[] stringArray = row["Version"].ToString().Split('.');
Line 515 -----> switch (stringArray[0] + "." + stringArray[1] + ".")
{
case "11.0.":
sqlServerVersion = "SQL Server 2012";
file.WriteLine("SQL Server 2012");
break;
case "10.50.":
sqlServerVersion = "SQL Server 2008 R2";
file.WriteLine("SQL Server 2008 R2");
break;
case "10.0.":
sqlServerVersion = "SQL Server 2008";
file.WriteLine("SQL Server 2008");
break;
case "9.00.":
sqlServerVersion = "SQL Server 2005";
file.WriteLine("SQL Server 2005");
break;
}
}`
If Someone can help me please... thanks.