Peter Chan
asked on
Problem to DDL
Hi,
I have the condition shown below
I have the condition shown below
sql = "select code,dscr from c_status where deleted = '0' and dscr in('便利店要求回收','已回收','退回SF') and system = 'OK' order by id ";
ddlStatus3.DataSource = dt;
ddlStatus3.DataValueField = "code";
ddlStatus3.DataTextField = "dscr";
ddlStatus3.DataBind();
...
to only show the items above, while the page having this <td style="width:70px">狀態 :</td>
<td style="width:114px">
<asp:DropDownList ID="ddlStatus3" runat="server">
</asp:DropDownList>
</td>
...
is not showing the 3 items as expected, while on the same page, there is no other DataBind to the DDL. why?
Did you remove the execute query part in the above code Purposefully? Or you didn't implement the part of executing the query?
ASKER
I did already have the databind as shown in above. I do not see any other codes refreshing the DDL.
But where are you querying database?
ASKER
I have query to bind to the DDL in above, right?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try above links on how to populate dropdown or combo boxes
ASKER
Yes, I know the way.
but the only issue is, why I can't apply the criteria to the DDL and only show the expected records as expected?
but the only issue is, why I can't apply the criteria to the DDL and only show the expected records as expected?
ASKER
Any other help?
Can you post the full code on how you are querying the database.
also...can you post the code from where you are loading the dropdown list?
also...can you post the code from where you are loading the dropdown list?
ASKER
I only have these codes
sql = "select code,dscr from c_status where deleted = '0' and dscr in('便利店要求回收','已回收','退回SF') and system = 'OK' order by id ";
ddlStatus3.DataSource = dt;
ddlStatus3.DataValueField = "code";
ddlStatus3.DataTextField = "dscr";
ddlStatus3.DataBind();
to initialize the DDL.
But where is that code in code behind file...