I have user into my system having information like(name,email,password,id,District,Tehsil,UC,Village)
ONE User can have one or many Districts
One user can have NO or many TEhsil
One user can have NO or many UCS
One user can have no or many Villages
These are cascade in nature District----------Populates-------->Tehsils
Tehsils----------Populates---------UC
UC-------------Populates-------Villages
I have create table from where my checkbox list getting values like this cascade nature but for save what i should do how many table should i have to create to save these records.
please share some example if any one have
Loading

Danish HabibPosted Feb 4, 2015, 12:09 AM
with Previious Database structure While I go into the edit mode i get 70 Rows in datareader and my reader loops row by row and then if the district id is one then it populatest just those tehsils where the foreign key district id is one and then loop through and check the comming value from database and the actual value if they match it makes it checked same for UC,Villages
As they are cascade like that District---->tehsil---->uc---->Villages
If i use dropdown then i also have to bind other dropdown like I have to bind tehsil dropdown based on the district dropdown value .....(because I want to show not all villages just the villages where the Foreign key UCID present ...
R u getting me?
just let me know with same database i want to give the previleges to the user to edit and make changes mean can add another district,tehsil,uc,villages with previous one any example please share
Joginder BangerPosted Feb 3, 2015, 3:05 PM
Danish HabibPosted Feb 3, 2015, 4:09 AM
For District TEhsil ,UC,Village I have checkbox and this form is placed in a view and on edit i am calling my view by active view index of multiview and show the form in edit mode same form with values from database , Now If a user has been assigned 200 Villages first time and on edit he want to assign more villages that in mind i place cascade checkbox so if he/she want to add another then he can , i also attached a image of my form
Joginder BangerPosted Feb 3, 2015, 4:03 AM
Danish HabibPosted Feb 3, 2015, 3:24 AM
Danish HabibPosted Feb 3, 2015, 3:12 AM
I have the same Table Structure As you told me the problem with me is that I have a user having 200 Villages Assigned to him so my using the below query
"SELECT U.UserId,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
I get 200 Rows so how to make each checkboxlist or any other control checked if its value comming from the database and my data reader when have 200 rows it loops one by one and take more than 2 minute to fetch 100 records and for 200 it ends without completion please assist me that how to make checkboxlist or any other control checked if its value comming and not checked if its value not commming and you must consider that if I am getting
Dim strChkID As String = drUser("DistrictID")
district id 1 then my tehsil checkbox should only list those tehsil where the foreign key district id is one and then select those whose value are present in database
Joginder BangerPosted Feb 3, 2015, 1:53 AM
Danish Habib,
you have different type of problem always , m kidding man. i am consider only your first problem about the table. this is my point of view not a universal true, Ok I think you need a five table
like this type
first table column Name (id,name,email,password,fk_District,Fk_Tehsil,fk_UC,Fk_village ) Table Name Customer
second table (id,District) table_name District
thrid table (id,Thisil,Fk_district) table_name Thisil
fourth Table (id,UC) table Name UC...I have no idea what is UC.
fifth table (id,village,fk_thisil_id) table Name village.
Second problem.
why are used the checkbox you are used the list box or any tool are available in asp.net toolbox.
Danish HabibPosted Feb 3, 2015, 1:06 AM
Riddhi ValechaPosted Feb 3, 2015, 12:37 AM
Create table as follows -
User_Master
Transaction_Table