Hi Everyone,
Hope you ppl are doing good, I need a suggestion.I have been working on Performance tuning.Consider the below Scenario
Three tables from Database A,B,C
Primary key in A and same Foreign keys in B and C
We retrieved three tables and performing a looping based on the Primary Key ID.in the following manner
Scenario 1
for
{
for
{
if A Primary is Equal to B Foreign{}
}
for
{
if A Primary is Equal to C Foreign{}
}
}
We all knew It loops more times ..I have more than 100 records in each table..
Now i cosidered to add Datarelation in dataset between three tables.
and use the below coding
Scenario 2
foreach(datarow dr in A.rows)
{
foreach(Datarow dr1 in dr.GetChildRows("RelationName"))
{
}
}
}
Please suggest me guys.
Loading
Amit ChoudharyPosted Aug 30, 2011, 7:40 AM
In the EntityFramework the model gets generated with relations over the different tables provides the functionality to directly access the related objects. So It should be good way to go with relations..