gender in c#
How to create Gender with 2 radiobtns i.e M/f and datetimepicker in winforms ..Plz Help
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Raja TPosted Dec 24, 2015, 11:49 AM
DOB -datetime
MAIL- varchar(20)
GENDER- char(1),( radiobtn as Male &Female)
Status - bit with (combobox 0,1)
Changed To
DOB -datetime
MAIL- varchar(20)
GENDER- varchar(10),( radiobtn as Male &Female)
Status - bit with (combobox 0,1)
And also please check combo box value 0,1 if not 0,1 change again status data type bit to char(10).
Rajeesh MenothPosted Dec 24, 2015, 10:47 AM
Put a varchar or int for radio button value.If you are saving male or female selected value then use in like 1 is male 0 mean female,otherwise directly add the text.
Ashok KumarPosted Dec 24, 2015, 10:37 AM
I got an Error while inserting values to DB
Rajeesh MenothPosted Dec 24, 2015, 10:21 AM
Check the below reference.
http://guidecoders.blogspot.in/2012/01/radio-button-example-male-and-female.html?m=1
Rajeesh MenothPosted Dec 24, 2015, 10:09 AM
In your query only one gender column so why u use 2 radiobutton ? If you want to select male and female details in single radiobutton then use radiobuttonlist..inside the radiobutton add two list and add same group name
Ashok KumarPosted Dec 24, 2015, 10:02 AM
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
}
plz help..!Raja TPosted Dec 24, 2015, 9:22 AM
Ashok KumarPosted Dec 24, 2015, 9:01 AM
sorry can u explain clearly.
SqlDataAdapter SDA = new SqlDataAdapter("INSERT INTO Employee ( EmpId ,Name, DOB Country, Gender) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + dateTimePicker1.Text +'" + comboBox2.Text + "','" + radioButton1.Text + "','" + radioButton2.Text + "')", con);
Rajeesh MenothPosted Dec 24, 2015, 8:59 AM
put a same groupname in radio button.then you can select one radiobutton at a time.