Database Query
-
Dear Sir, I am Danish Habib and i get struck with an issue and i have placed my question in many forums but no one still replied to me which is consider as best solution ,The problem statement is below I have a web application in which i have users and user have the following information (userid,name,email,Passowrd,SecurityQuestion,SecurityAnswer,District,Tehsil,UC,Villages) So the business rules are as follows 1-One user can have one or more districts 2-One user can have no or many tehsils. 3-One user have have no or many ucs. 4-One user can have no or many villages these are cascade in nature like that District------>populates------->Tehsisl Tehsils-------->Populates ------->UCs UCs-------------->populates------Villages So i have made four tables one for basic infromation of user like (userid(P),name,email,password,securityquestion,securityanswer) 4 more tables are DistrictVSUsers(Userid(F),DistrictID(P),DistrictName) TehsilsVsUser(Userid(F),Tehsil(ID),TehsilName,DIstrictID(F)) UCsVsUser(Userid(F),UCID,UCNAME,TEHSILID(F)) VillageVsUSers(USerid(F),VillageID,Villagename,UCID(F)) These are five table nor four ... These table are for saving purposes for showing the cascaded records i have used checkboxlist on selection of district checkboxlist the tehsil checkboxlist will populats and on selection of tehsil checkxboxlist the uc checkboxlist populats and on selection of uc checkboxlist the villages checkboxlist item populates ...so this working fine .. Now For saving the data I am using the loop first loop goes for district and save all the district then the next loop for tehsil and then the next for UC and then the next for Villages ................. So I have assigned one user with 71 villages and now when on edit i want to show the check box checked whose values are present into the database i am getting 71 rows using data reader "SELECT U.UserId,U.[Address],U.City,u.Country,UT.TehsilId,UC.UCID ,UC.UCName,UV.VillageId ,UV.VillageName ,UT.TehsilName,U.DistrictId,UD.DistrictName ,UD.DistrictId ,UD.UserId,U.FullName,U.IPAddress,U.IsActive,U.IsAdmin,U.IsPasswordReset,U.IsReportable,U.IsVisible,U.CreateDate ,U.Mobile,U.Password,U.ReporintPerson,U.SecurityAnswer,U.SecurityQuestion ,U.UserId,U.Email,U.UserTypes FROM Users U INNER JOIN UserDistricts UD ON UD.UserId=U.UserId AND UD.DistrictId=U.DistrictId INNER JOIN UserTehsils UT ON UT.UserID=U.UserId AND UT.DistrictId=UD.DistrictId INNER JOIN UserUcs UC ON UC.UserID=U.UserId AND UC.TehsilId=UT.TehsilId INNER JOIN UserVillag
-
Dear Sir, I am Danish Habib and i get struck with an issue and i have placed my question in many forums but no one still replied to me which is consider as best solution ,The problem statement is below I have a web application in which i have users and user have the following information (userid,name,email,Passowrd,SecurityQuestion,SecurityAnswer,District,Tehsil,UC,Villages) So the business rules are as follows 1-One user can have one or more districts 2-One user can have no or many tehsils. 3-One user have have no or many ucs. 4-One user can have no or many villages these are cascade in nature like that District------>populates------->Tehsisl Tehsils-------->Populates ------->UCs UCs-------------->populates------Villages So i have made four tables one for basic infromation of user like (userid(P),name,email,password,securityquestion,securityanswer) 4 more tables are DistrictVSUsers(Userid(F),DistrictID(P),DistrictName) TehsilsVsUser(Userid(F),Tehsil(ID),TehsilName,DIstrictID(F)) UCsVsUser(Userid(F),UCID,UCNAME,TEHSILID(F)) VillageVsUSers(USerid(F),VillageID,Villagename,UCID(F)) These are five table nor four ... These table are for saving purposes for showing the cascaded records i have used checkboxlist on selection of district checkboxlist the tehsil checkboxlist will populats and on selection of tehsil checkxboxlist the uc checkboxlist populats and on selection of uc checkboxlist the villages checkboxlist item populates ...so this working fine .. Now For saving the data I am using the loop first loop goes for district and save all the district then the next loop for tehsil and then the next for UC and then the next for Villages ................. So I have assigned one user with 71 villages and now when on edit i want to show the check box checked whose values are present into the database i am getting 71 rows using data reader "SELECT U.UserId,U.[Address],U.City,u.Country,UT.TehsilId,UC.UCID ,UC.UCName,UV.VillageId ,UV.VillageName ,UT.TehsilName,U.DistrictId,UD.DistrictName ,UD.DistrictId ,UD.UserId,U.FullName,U.IPAddress,U.IsActive,U.IsAdmin,U.IsPasswordReset,U.IsReportable,U.IsVisible,U.CreateDate ,U.Mobile,U.Password,U.ReporintPerson,U.SecurityAnswer,U.SecurityQuestion ,U.UserId,U.Email,U.UserTypes FROM Users U INNER JOIN UserDistricts UD ON UD.UserId=U.UserId AND UD.DistrictId=U.DistrictId INNER JOIN UserTehsils UT ON UT.UserID=U.UserId AND UT.DistrictId=UD.DistrictId INNER JOIN UserUcs UC ON UC.UserID=U.UserId AND UC.TehsilId=UT.TehsilId INNER JOIN UserVillag
The reason you are not getting any answers is that you are not asking your question in a way that makes it easy to understand. You are also not even asking any real question at all. You are simply stating a bunch of facts... And then saying "It's slow, help me". You will get much better results if you rewrite your question with very specific questions, and provide only the code necessary to recreate the problem. Ask questions that can be answered explicitly, not open ended questions. We don't know what to do with "It's slow, please help me".
-- Where are we going? And why am I in this handbasket?
-
Dear Sir, I am Danish Habib and i get struck with an issue and i have placed my question in many forums but no one still replied to me which is consider as best solution ,The problem statement is below I have a web application in which i have users and user have the following information (userid,name,email,Passowrd,SecurityQuestion,SecurityAnswer,District,Tehsil,UC,Villages) So the business rules are as follows 1-One user can have one or more districts 2-One user can have no or many tehsils. 3-One user have have no or many ucs. 4-One user can have no or many villages these are cascade in nature like that District------>populates------->Tehsisl Tehsils-------->Populates ------->UCs UCs-------------->populates------Villages So i have made four tables one for basic infromation of user like (userid(P),name,email,password,securityquestion,securityanswer) 4 more tables are DistrictVSUsers(Userid(F),DistrictID(P),DistrictName) TehsilsVsUser(Userid(F),Tehsil(ID),TehsilName,DIstrictID(F)) UCsVsUser(Userid(F),UCID,UCNAME,TEHSILID(F)) VillageVsUSers(USerid(F),VillageID,Villagename,UCID(F)) These are five table nor four ... These table are for saving purposes for showing the cascaded records i have used checkboxlist on selection of district checkboxlist the tehsil checkboxlist will populats and on selection of tehsil checkxboxlist the uc checkboxlist populats and on selection of uc checkboxlist the villages checkboxlist item populates ...so this working fine .. Now For saving the data I am using the loop first loop goes for district and save all the district then the next loop for tehsil and then the next for UC and then the next for Villages ................. So I have assigned one user with 71 villages and now when on edit i want to show the check box checked whose values are present into the database i am getting 71 rows using data reader "SELECT U.UserId,U.[Address],U.City,u.Country,UT.TehsilId,UC.UCID ,UC.UCName,UV.VillageId ,UV.VillageName ,UT.TehsilName,U.DistrictId,UD.DistrictName ,UD.DistrictId ,UD.UserId,U.FullName,U.IPAddress,U.IsActive,U.IsAdmin,U.IsPasswordReset,U.IsReportable,U.IsVisible,U.CreateDate ,U.Mobile,U.Password,U.ReporintPerson,U.SecurityAnswer,U.SecurityQuestion ,U.UserId,U.Email,U.UserTypes FROM Users U INNER JOIN UserDistricts UD ON UD.UserId=U.UserId AND UD.DistrictId=U.DistrictId INNER JOIN UserTehsils UT ON UT.UserID=U.UserId AND UT.DistrictId=UD.DistrictId INNER JOIN UserUcs UC ON UC.UserID=U.UserId AND UC.TehsilId=UT.TehsilId INNER JOIN UserVillag
-
It is very hard to understand what your actual question is. I'd suggest simplifying this down to just the relevant parts and ask a specific question.
There are only 10 types of people in the world, those who understand binary and those who don't.
true
KiranKumar Roy