I have a sceniro that i have dropdowns on my webpage .I select their vlaues and sved them into database mean in database i am sending the ids or foreign keys Problem is that in may main table i just have id and its description is in its main table so when
i populate value from Gridview than it just have id so i have to send this id back to database and use this type of query
Select id,description from abc where id = '05' union all select * from abc where id<>'05'
zubair_devel...
Member
4 Points
31 Posts
Populate Dropdown form grid view
Apr 26, 2012 07:57 AM|LINK
Hi All,
I have a sceniro that i have dropdowns on my webpage .I select their vlaues and sved them into database mean in database i am sending the ids or foreign keys Problem is that in may main table i just have id and its description is in its main table so when i populate value from Gridview than it just have id so i have to send this id back to database and use this type of query
Select id,description from abc where id = '05' union all select * from abc where id<>'05'
resulted will be like this
ID Description
05 karachi
01 Lahore
02 Multan
03 Islamabad
04 Peshawar
06 Hyderabad
07 Sukkur
.
.
.
.
Is there any easy way to do this type of task
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: Populate Dropdown form grid view
Apr 30, 2012 05:53 AM|LINK
Binding the DropDownList with your result:
DropDownList1.DataSource = result;
DropDownList1.DataValueField = "ID";
DropDownList1.DataTextField = "designation";
DropDownList1.DataBind();
If I have misunderstood your concerns, don't hesitate to let me know.
Feedback to us
Develop and promote your apps in Windows Store