>DataTable dt = new DataTable(); >dt.Columns.Add("name",typeof(String)); >dt.Columns.Add("datehired", typeof(DateTime)); >dt.Columns.Add("salary",typeof(Decimal)); >dt.Columns.Add("active", typeof(Boolean)); > >dt.Rows.Add("Kevin Goff", new DateTime(2000, 1, 1), 100000, true); >dt.Rows.Add("John Doe", new DateTime(2001, 11, 11), 50000, false); > >object odcvalue; >string cColumnName; > >foreach (DataRow dr in dt.Rows) > foreach (DataColumn dc in dt.Columns) { > cColumnName = dc.ColumnName.ToString(); > odcvalue = dr[dc]; > // if you want to do something with the object, check the datatype of the column object and > // proceed accordingly > } > > >I found there there is no way of obtaining that information from the data row. As you mentioned, we have to go through the datatable route. Given the fact that we are doing a SQLExec command, which returns one record, and make us of loRow to get the field, it is somewhat difficult to create a datatable to collect that information.