hi Guys

Am running through a code by a previous Developer and am trying to understand what he was doing , i do things differently, he likes XML and i like doing Direct Access to the DB , but going through a Data Layer , So i can Across a Code that was a little bit Confusing for me , because i was not doing things this way. i have the Following code

Code:
string sql = "";

        foreach (UltraGridRow row in ultraGridSubjects.Rows)
        {
            foreach (UltraGridCell cell in row.Cells)
            {
                if ((cell.Key == "Term") || (cell.Key == "Container"))
                {
                    Type typ = cell.Value.GetType();
                    if (typ.FullName == "System.String")
                    {
                        foreach (ValueListItem vItem in cell.Column.ValueList.ValueListItems)
                        {
                            if (vItem.DisplayText == cell.Value.ToString())
                            {
                                cell.Value = vItem.DataValue;
                            }
                        }
                    }
                }
            }
        }
        
        sql = "sp_Subjects_Save '" + CommonFunctions.BuildXmlFromUltraGrid(ultraGridSubjects) + "' ";
        ((ControlDesk)Page.Master).WarningText = CommonFunctions.ExecuteStoredProc(sql);

        ultraGridSubjects.DataBind();
The UltraGrid is a third party Control, thats like Gridview in ASP.NET 2.0, can someone summarise the code and tell what is happing in this code like this part

Code:
      sql = "sp_Subjects_Save '" + CommonFunctions.BuildXmlFromUltraGrid(ultraGridSubjects) + "' ";
        ((ControlDesk)Page.Master).WarningText = CommonFunctions.ExecuteStoredProc(sql);

Thanks