anjana81
asked on
How to get the value from database row wise using ado.net entity framework
Hi,
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
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.
Thanks
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.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks