I have an application having hierarchical Data mean cascaded data below is the hierarchy of that database
District------>populates Tehsils
Tehsils------->Populates UCS
UCS----------->Populates Villages
Now I want to save these against each user I have created these tables
User(userid(P),Username)
UserDistrict(DistrictId(P),Districtname,Userid(F))
UserTehsils(TehsilID(P),TehsilName,DistrictId(F),UserId(F))
UserUC(UcID(P),UCNAME,TehsilID(F),UserID(F))
UserVillages(VIllageID(P),VillageName,UCID(F),Userid(F))
I have created Four Method each one is using its own table value parameter , but the problem is that when i am going to save data into the UserTehsil here i need the district id too, so i have created a method in .vb code which pass that Tehsil id to tehsil table and get the district id from there , and my saving process taking more than 3 minutes to get complete any idea.
Table Value parameter
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Abhineet SrivastavaRank #1,890 · 783 reputationPosted Apr 16, 2015, 9:29 AM EDT
If same then First Insert record int TEhsil Table & Get District ID using scope identity,Then insert into District Table
Danish HabibRank #2,024 · 715 reputationPosted Apr 16, 2015, 9:36 AM EDT