I have a drop down list that is populated by a stored procedure which has two int parameters (ID, STATUS). I need to default the drop down list to a value in the database that is associated to the ID & STATUS parameters.The problem I am having is that it only works if the selected value is the first record on the drop down list. for any other records (outside the first record) from the drop down list i get "The 'SelectedIndex' and 'SelectedValue' attributes are mutually exclusive."Here is the stored procedure I am using to populate the drop down list: ALTER PROCEDURE [dbo].[usp_SelectName]( @pId Int, @pStatus Int)ASBEGIN IF @pId = -1 --THIS VALUE IS USED AS DEFAULT (NOT POSTBACK) BEGIN if @pStatus <> -1 BEGIN SELECT * FROM TABLE_NAMES WHERE IN_STATUS = @pStatus ORDER BY IN_NAME END ELSE BEGIN SELECT * FROM TABLE_NAMES ORDER BY IN_NAME END END ELSE BEGIN SELECT * FROM TABLE_NAMES inner join TABLE_2ON TABLE_2.IN_ID = TABLE_NAMES_IN_ID WHERE IN_ID = @pId ENDEND
Here is the TABLE_NAMES that holds the data for the drop down list:IN_ID IN_NAME STATUS6 New 04 Generic 03 Local 14 Storm 0
This is the TABLE_2 that holds the complete collected FORM data that has the selected record IN_ID from the TABLE_NAME:ID STATUS IN_ID1119 0 61144 0 61145 0 51146 0 61147 0 6