Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have built this little application based on C# and sql server it works fine before publishing it runs well no problems whatsoever, what surprised me is after publishing the app and installing it i noticed that the combobox value does not update instantly when i add to it like it should be and does so before publishing

What I have tried:

private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                state = "add";
                DataTable Dt = new DataTable();
                Dt = CBE.VerifyCrime(textBox1.Text);
                if (Dt.Rows.Count > 0)
                {
                    MessageBox.Show("DUBLICATION", "RECORD DUBLICATED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textBox1.Focus();
                    textBox1.SelectionStart = 0;
                    textBox1.SelectionLength = textBox1.TextLength;
                    return;
                }
                CBE.addcrime(textBox1.Text);
                MessageBox.Show("NEW CRIMINAL BEHAVIOR ADDED ", "ADD", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.dataGridView1.DataSource = CBE.getallgridview();

                FRM_SUSPECT.getMainForm.CBOBOX.DataSource = sus.Getallcrimebehaviour();
                FRM_SUSPECT.getMainForm.CBOBOX.SelectedIndex = -1;

                FRM_SUSPECT.getMainForm.CBOBOX2.DataSource = sus.Getallcrimebehaviour();
                FRM_SUSPECT.getMainForm.CBOBOX2.SelectedIndex = -1;
            }
            catch
            {
                MessageBox.Show("error");
                return;
            }
        }
Posted
Comments
j snooze 26-Oct-17 17:42pm    
If there are no errors, can you verify in the database after clicking add that the value is indeed added to where its supposed to be? Its not pulling from cached data or anything is it? (looks to be a winform so I'm assuming not, but I cant' see what sus.Getallcrimebehavior does)..also did you remember to aim your installed app at the correct sql server? perhaps its still aimed at your test box?
Richard Deeming 27-Oct-17 14:00pm    
"DUBLICATION ... RECORD DUBLICATED"

Did you have a cold when you wrote this? :o)

(It should be "Duplication" and "Duplicated".)
sefax barbaro 4-Nov-17 11:27am    
lol actually yes, I had a horrible headache that day and was half asleep :D

anyways thanks for ur comment mate, i managed to fix it lol

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900