I want to save some related records I.e I have users into my system the users have the following fields (username,email,District,Tehsil,Uc,Villages)
The Districts have Tehsils,The Tehsils have ucs and the ucs have villages Now i am using th while loop and its slow the saving process very much any one guide me for batter approach and share any liked similar work with me please
Loading

Danish HabibPosted Dec 10, 2014, 9:44 AM
Wim SturkenboomPosted Dec 10, 2014, 9:37 AM
I'm not a VB person (C#), so still trying to figure a few things out. It might take a while though.
Danish HabibPosted Dec 10, 2014, 6:29 AM
User table(userid,Username,Email,Password,Security Question,SecurityAnswer,District(from which he belongs to)
The Location hierarchy is like that (districts populates Tehsils ->mean one district can have many tehsils, and tehsil populate Ucs ->mean one tehsil may have many ucs in it , and Ucs populate villages (means->one uc may have 100 of villages ) so the story is like that one user may belong to just one district and 2 tehsil and 4 ucs and 20 villages in these ucs .so below is the code whcih i am using
"If Not Page.IsValid Then Return
locally it works fast but when hosted its too slow , I have made four tables for that one table contains user basic information Name,email,District , another table contains userid,with districts and tehsil id, another table contains userid districtid and tehsilid and uc id, another table contains userid,districtid,tehsilid,ucid,villagesid ,so what is the other way this way is not a good way whcih i am using below is the attached form of user:
please respond
Kind Regards
Danish HAbib
Wim SturkenboomPosted Dec 10, 2014, 5:19 AM
Maybe you can explain why you're looping? Maybe show the relevant code. So we can try to understand what you're doing and why you're looping.
Danish HabibPosted Dec 10, 2014, 4:31 AM
Wim SturkenboomPosted Dec 10, 2014, 3:45 AM
If so
Assuming you have tables for district, tehsil, uc and villages, you basically only have to store the village with the user information; the other information (uc, tehsil, district) can be retrieved when you retrieve the user's record form the database.