Home>

I'm making windowsform in visualstudio2017.
https://nonbiri-dotnet.blogspot.com/2016/12/blog-post_29.html
The data stored in the database is stored by column specification with reference to.
A program that stores data in the database when the button is pressed

private void button1_Click (object sender, EventArgs e)
        {
            cn.ConnectionString = cnstr;
            cn.Open ();
            cmd.Connection = cn;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "INSERT INTO [dbo]. [TEXT] VALUES (" +
                               "N '" + textBox2.Text + "')";
            MessageBox.Show ("Saved in database");
            rd = cmd.ExecuteReader ();
            rd.Close ();
            cn.Close ();
            textBox2.Clear ();
        }


Made.
However, the data stored by pressing the button is not stored in combBox.
However, when windowsform is closed and launched, the stored data is stored in combBox.
So please tell me how to add data to combBox when you insert by pressing the button without closing and opening windowsform.

// TODO: This line of code reads data into the 'database1DataSet.TEXT' table.
this.TEXTTableAdapter.Fill (this.database1DataSet.TEXT);

>>Products
Windows Form
>>Search
c # combobox datasource I checked it with the update, but it was not found.
>>Development environment
Visual Sutaudio2017, C # ,. NET Framework4.7, SQL Server Express2017, Windows10