Quantcast
Viewing all articles
Browse latest Browse all 12583

Automatically write checkbox checked state to dabase table

I am trying to automatically update a table when a checkbox is clicked.  The code below works, but only after the second time it is run.  What am I doing wrong? 

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            this.Plans_BindingSource.EndEdit();
            DataRow dataRow = ((DataRowView)((BindingSource)this.Plans_BindingSource).Current).Row;
            if (dataRow != null)
                this.Plans_TableAdapter.Update(dataRow);
        }


Kipp Woodard


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>