Need logic for dropdown selected item while getting data to the page


Jul 1, 2013
Programming Experience
I am new to .Net,Will anyone help me how to write the logic for below scenario.

1)In the database if data is null then dont dispaly panel -Id for panel in aspx(SaniListPanel)we need make it false.

sanScrRow["Reason"] -- Reason is the column in database and sanscrRow is datarow.

Note: Reason is an integer in database I mean datatype because in database while updating it will update as integer like ID based on lookup values.while retrieving back to the page I mean getting details back to the page it has to display the panel when there is any data which is already updated in database.
In the dropdown it has to show text.with selected item not value
In the database for this lookup id's we have description and this populate in dropdownlist

"LookupValueDescription", "LookupID"); Description is text field and ID is value field in populating the dropdown.

2)if there is value in database(suppose if not null then convert to integer)

3)set the selected value for dropdownlist(lstSanList) to the above integer.

Need help please....
Top Bottom