I have a string called SelectedItem that i want to split into 5 strings to then use in a textbox. The code is below:
string[] Details = SelectedItem.Split(',');
string EmployeeID = Details[0];
string EmployeeName = Details[1];
string EmployeePay = Details[3];
string EmployeeHours = Details[4];
decimal TempWage = int.Parse(Details[3]) * int.Parse(Details[4]);
string EmployeeWage = TempWage.ToString();
TbxWage.Text = "Employee " + EmployeeID + "Wage Details " + Environment.NewLine + "pay rate is " + EmployeePay + Environment.NewLine + "Working Hours is " + EmployeeHours + Environment.NewLine + "Wage is " + EmployeeWage;
This code should run when I click a certain button but instead I get "Index was outside the bounds of the array" and I don't understand what it means.