Below is source code: but not certain why I am getting a Key not found - tried Binding at Runtime to datasource without any schema defined. Also defined schema and no use.
UltraDataSource src = new UltraDataSource();
src.Band.Columns.Add(
"Phase");
"Unit Code");
"Unit Description");
"Maintainable Items", Type.GetType("System.Nullable`1[System.Int32]"));
"Technology Type Assigned", Type.GetType("System.Nullable`1[System.Int32]"));
"Size Assigned", Type.GetType("System.Nullable`1[System.Int32]"));
"Service Assigned", Type.GetType("System.Nullable`1[System.Int32]"));
"FMECA Assigned", Type.GetType("System.Nullable`1[System.Int32]"));
while(reader.Read())
{
string sPhase = reader[0].ToString();
string sUnitCode = reader[1].ToString();
string sUnitDesc = reader[2].ToString();
int iTotal = reader.GetInt32(3);
int iTTTotal = reader.GetInt32(4);
int iSizeTotal = reader.GetInt32(5);
int iServiceTotal = reader.GetInt32(6);
int iFMECATotal = reader.GetInt32(7);
object[] values = { sPhase, sUnitCode, sUnitDesc, iTotal, iTTTotal, iSizeTotal, iServiceTotal, iFMECATotal };
src.Band.DataSource.Rows.Add(values);
}
reader.Close();
breakdownGrid.DataSource = src;
Yes, it was initialize layout that was giving the error - thanks...
My guess is that the exception is occurring in a grid event like InitializeLayout or InitializeRow and your code is trying to refer to a column that does not exist.