i wanted to ask when we want to fill dropdownbox with value from the database
we write
like this
query "select id , Name from emloyee"
dtTable ---> DataTable;
DropDownList1.DataSource = dtTable;
DropDownList1.DataTextField = "Name";
DropDownList1.DataValueField= "Id";
DropDownList.DataBind();
in the code if we dont write " DropDownList1.DataValueField= "Id";" still the dropdown is getting filled with all the id so y do we write that code --> DropDownList1.DataValueField= "Id";<--
OR VICEVERSA
if we dont write --->DropDownList1.DataTextField = "Name";<---- and still the dropdown is getting filled with all the id so y do we write that code --> DropDownList1.DataValueField= "Id";<--
what is the importanceof that
can some please tell me