I am new in using ADO.NET entity data model. I would like to extract the column name and the corresponding row values from the sql server database for my program.
I use the code below
MyPgmEntities context = new MyPgmEntities();
var customer= from c in context.tblcustomer select c;
Object LinqObject = new tblcustomer ();
foreach (var c in customer)
foreach (PropertyInfo pi in LinqObject.GetType().GetProperties())
//Get Column Name
string sAtt = pi.Name;
//Get row value for the corresponding column name 'sAtt'
Using the above code I am able to get the column name. But I would like to know how to loop through and get the corresponding row values in the database.