why the following code doesn't work?
internal static string[] GetToolsForRole(string selectedRole) {
string[] tempStr;
ArrayList myAL = new ArrayList();
SqlCommand cmd = new SqlCommand("usp_TD_SelectByRoleName");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@role", SqlDbType.NVarChar, 50).Value = selectedRole;
SqlConnection myConnection = Util.GetConnection();
cmd.Connection = myConnection;
SqlDataReader reader = cmd.ExecuteReader();
int i = 0;
while (reader.Read()) {
tempStr[i] = reader["TD_Name"].ToString();
i++;
}
return tempStr;
}
List<T>.List<T>. (I have no sources for that statement)