Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Database Query

Database Query

Scheduled Pinned Locked Moved ASP.NET
databasehelpbusinessquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Malikdanish
    wrote on last edited by
    #1

    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

    E Z 2 Replies Last reply
    0
    • M Malikdanish

      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

      E Offline
      E Offline
      Erik Funkenbusch
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • M Malikdanish

        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

        Z Offline
        Z Offline
        ZurdoDev
        wrote on last edited by
        #3

        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.

        K 1 Reply Last reply
        0
        • Z ZurdoDev

          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.

          K Offline
          K Offline
          KiranKumar Roy
          wrote on last edited by
          #4

          true

          KiranKumar Roy

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups