比如设定文章有效性,有效则表中valid为1,无效则标识0.
 
。。。。读取数据库数据,读取到datatable中,dt为datatable的table名。
 
 if (dt.Rows[0]["valid"].ToString() == "1")
            {
                RadioButtonList1.Items[0].Selected = true;
                RadioButtonList1.Items[1].Selected = false;
            }
            else {
                RadioButtonList1.Items[0].Selected = false;
                RadioButtonList1.Items[1].Selected =true ;
            }