c# - Gridview should display dropdownlist "Text" which is selected instead of "Value" -


i have form in have 2 dropdownlist "status" & "shelf" both have sql datasources , dependent. when ever insert record, enters "status" & "shelf" columns contain "values" instead of "text".

since set parameters using selectedvalue property, datavaluefield bounded droupdown list. if need datatextfield, try below

command.parameters.addwithvalue("@status", ddlstatus.selecteditem.text); command.parameters.addwithvalue("@shelf", ddlshelf.selecteditem.text); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -