Exemplo n.º 1
0
        private void SaveTask()
        {
            try
            {
                foreach (DataGridViewRow row in dgvTask.Rows)
                {
                    bool IsChecked = Convert.ToBoolean(row.Cells[5].Value);

                    if (row.Cells[1].Value == DBNull.Value)
                    {
                        row.Cells[1].Value = string.Empty;
                    }
                }
                taskAdapter = new tasksTableAdapter();
                taskAdapter.Update((tasksDataTable)dgvTask.DataSource);
                taskAdapter.Dispose();
                dgvTask.DataSource = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }