前台:
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal">
<asp:ListItem Value="0">男</asp:ListItem>
<asp:ListItem Value="1">女</asp:ListItem>
<asp:ListItem Value="2">保密</asp:ListItem>
</asp:RadioButtonList>
后台:
if (RadioButtonList1.SelectedValue == "0")
{
sqlcmm.Parameters.Add("@sex", System.Data.SqlDbType.NVarChar, 50).Value = "男";
}
else if (RadioButtonList1.SelectedValue == "1")
{
sqlcmm.Parameters.Add("@sex", System.Data.SqlDbType.NVarChar, 50).Value = "女";
}
else
{
sqlcmm.Parameters.Add("@sex", System.Data.SqlDbType.NVarChar, 50).Value = "保密";
}