Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have to update a table where state_id and city_id have int data type stored.
but when the user loggs in his details are displayed. but the problem is that when he sees his state , and city so the user can only see stat_id and city_id. as 1 or 2... or so on..
but i want selected state name and city name to be displayed instead of state_id, city_id.
and i used detailsview.
Posted

1 solution

You must have bound your columns to State ID and City ID. That is why it is showing State ID and City ID.
You must know that computer is very dumb and does whatever you ask it to do.
 
Share this answer
 
Comments
Member 9671810 25-Mar-13 8:29am    
yup... but the table contains State_id and city_id... as a foreign key
Ankur\m/ 25-Mar-13 8:30am    
So get the State name and city name and bind your datalist to these columns and it will show the names. As simple as that!
Member 9671810 25-Mar-13 8:40am    
how?
note:" it is detailsview so here the user can update it"
Member 9581488 25-Mar-13 9:13am    
Try Joining two table. (say for exp:- userdetails and StateDetails join them with stateid)
Are you using dropdown for displaying that??
Ankur\m/ 25-Mar-13 12:38pm    
Step 1: Get required column from your database. Update the query if they are already not coming in the record set.
Step 2: Change the databound column to the corresponding state and city name column.
I don't understand what the problem is. If you need more help with this you will have to post your code here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900