设置DropDownList的当前选项

2019-05-12 08:56:09刘景俊

            myReader = myCmd.ExecuteReader(); 
            while (myReader.Read())
            {
//此句选中设置                
            rbtl_role.SelectedIndex = Convert.ToInt32(StateIndex[myReader["roleid"]].ToString());            
            }
            // always call Close when done reading.
            myReader.Close();
            // Close the connection when done with it.        
            myConnection.Close();            
        }

______________________________________________________________________________________________
答7:
imfine,感谢你,你的方法最直观:)