Problem to DDL

Hi,
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();
		...

Open in new window

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>
				...

Open in new window

is not showing the 3 items as expected, while on the same page, there is no other DataBind to the DDL. why?
LVL 11
HuaMin ChenProblem resolverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

srikanthreddyn143Commented:
Did you remove the execute query part in the above code Purposefully? Or you didn't implement the part of executing the query?
0
HuaMin ChenProblem resolverAuthor Commented:
I did already have the databind as shown in above. I do not see any other codes refreshing the DDL.
0
srikanthreddyn143Commented:
But where are you querying database?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

HuaMin ChenProblem resolverAuthor Commented:
I have query to bind to the DDL in above, right?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srikanthreddyn143Commented:
Try above links on how to populate dropdown or combo boxes
0
HuaMin ChenProblem resolverAuthor Commented:
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?
0
HuaMin ChenProblem resolverAuthor Commented:
Any other help?
0
srikanthreddyn143Commented:
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?
0
HuaMin ChenProblem resolverAuthor Commented:
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();

Open in new window

to initialize the DDL.
0
srikanthreddyn143Commented:
But where is that code in code behind file...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.