I have an app i'm developing, Each record is singular and unique in the DB, there will only ever be a couple dozen records (not that this matters)
i am trying to get the column name and the value to display in a listbox on the form (winforms c#, 4.5.2)
is what i have so far, its bombing out in the inner foreach loop, so its like its not loading the table structure. Stolen off the stack, so no guarantees its worthy of time etc. but all assistance appreciated.Code:var doc = cboPhysician.Items[cboPhysician.SelectedIndex] as pItem; var rec = (from a in db.DOCCREDs where a.DOC == doc.EEID select a).ToList(); var fields = typeof(DOCCRED).GetFields(); foreach(var it in rec) { foreach(var f in fields) { string s; s = f.Name + ':' + f.GetValue(it); lbxDocDetails.Items.Add(s); } }




Reply With Quote
