我是这样做的,随便写的,如果不行的话再问我。qq:576633389
把radiobutton1和radiobutton2的groupname设置为同一个名,如rb
SqlConnection con=new SqlConnection(System.Configuration.ConfigurantionManager.AppSetting["connectionstring"]);
con.Open();
SqlCommand com;
switch(rb.selectvalue)
{
case "男":
string instr="insert into table(sex) values('"+男+"')"";
break;
case "女":
string instr="insert into table(sex) values('"+女+"')""
break;
}
com=new SqlCommand(instr,con);
com.ExecuteNonQuery();
con.Close();