How To Add Or Insert Data From Radio Button To Datagridview In C Sharp Windows Application

How To Add Or Insert Data From Radio Button To Datagridview In C# Windows Application

How To Add Or Insert Data From Radio Button To Datagridview In C# Windows Application
How To Add Or Insert Data From Radio Button To Datagridview
How To Add Or Insert Data From Radio Button To Datagridview

This Tutorial shows How To Add Or Insert Data From Radio Button To Datagridview In C# Windows Application

C# SOURCE CODE

       private void button2_Click(object sender, EventArgs e)
        {
            String firstName = textBoxFirstName.Text;
            String lastName = textBoxLastName.Text;
            String gender = "";
            String country = "";

            if (radioButtonGenderMale.Checked == true)
            {
                gender = "Male";
            }
            else if (radioButtonGenderFemale.Checked == true)
            {
                gender = "Female";
            }

            country = comboBoxCountry.SelectedItem.ToString();

            MemoryStream ms = new MemoryStream();

            pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat);
            Byte[] img = ms.ToArray();

            dataGridView1.Rows.Add(firstName, lastName, gender, country, imagePath, img);

            //dataGridView1.DataSource = table;
        }

READ MORE  C SHARP AND MYSQL DATABASE CRUD TUTORIAL Insert Update Search Delete And Display Data On DataGridView Using Visual Studio 2010

Leave a Reply

Your email address will not be published. Required fields are marked *