Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Problem to Dropdownlist

Hi,
I have the codes like
 
        sql = LibUtil.GetSqlCodeVG(accessRight, dept);
        dt = DBUtil.GetCodeTable(conn, sql);
        ddlStore.DataSource = dt;
        ddlStore.DataValueField = "code";
        ddlStore.DataTextField = "dscr";
        ddlStore.DataBind();
 
    public static string GetSqlCodeVG(string accessRight, string dept)
    {
        string sql = @"select store_no code, sfzone, concat(ifnull(dscr,''),',  ',ifnull(store_no,'')) as dscr
            from c_store_vg c
            where deleted = '0' and dscr is NOT NULL ";
 
        sql += "order by dscr ";
 
        return sql;
    }
 

Open in new window

to fill the Dropdownlist. But after I've selected one value to the DDL, I check that
 
ddlStore.SelectedValue
 
is having empty value inside. why?
ASKER CERTIFIED SOLUTION
Avatar of ChloesDad
ChloesDad
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peter Chan

ASKER

Can you please show with example codes to your advice? thanks