D
dbuchanan
Hello,
I have encoutered the error show below after attempting to save a new
record. This happens about 90% of the time under a set of conditions
described later below.
The main form contains a dataGridView and a button on that form opens a data
entry form performs edits or deletes on the record selected or provisions
the form for adding a new record when a button for that purpose is clicked.
This error below happens under a special circumstance that has something to
do with what I describe next.
I have two dropdowns on the data entry form. These dropdowns are linked by a
binding source relationship (and a relationship in the xsd). Because of this
relationship when a selection is made in the first dropdown it filters the
possible selections in the second dropdown.
The first dropdown selects the dimension (i.e. linear, area, volume) the
second selects the unit of measure (inch, foot, inch^2, foot^2...)
When the user makes a selection in the first dropdown (for example liner),
the second dropdown displays the first possible item without actually
selecting the dropdown (in this instance inch), an error will be thrown.
(Note the second dropdown does display the value.)
Why doesn't the form accept the displayed value in the second dropdown? Is
there a work around?
Below the error text and two sections of code; user code and partial class
for the form
==== the error text ====
System.Data.NoNullAllowedException was unhandled
Message="Column 'fkMeasureUnitID' does not allow nulls."
Source="System.Data"
StackTrace:
at System.Data.DataColumn.CheckNullable(DataRow row)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs
args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32
proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position,
Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID,
Int32 pos, Boolean fireEvent)
at System.Data.DataView.FinishAddNew(Int32 currentIndex, Boolean
success)
at System.Data.DataRowView.EndEdit()
at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
at System.Windows.Forms.BindingSource.EndEdit()
at HIP2007.AddEditMasterTask.btnSave_Click(Object sender, EventArgs
e) in C:\HIP2007\HIP2007\CurrentWork\04_AddEditMasterTask.cs:line 145
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at
HIP2007.CreateConfigureMasterTasks.btnAddViewEditTasks_Click(Object sender,
EventArgs e) in
C:\HIP2007\HIP2007\CurrentWork\03_CreateConfigureMasterTasks.cs:line 77
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at HIP2007.Program.Main() in C:\HIP2007\HIP2007\Program.cs:line 19
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
=== end of the error text ===
=== use code ===
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace HIP2007
{
public partial class AddEditMasterTask : bsfAddEdit
{
// Avoid firing events during load
private bool _blnFormLoading = false;
// First record in Dgv or Edit
private bool _blnIsFirstRecordInDgv = false;
#region [ Constructors & InitializeMyForm
// Edit when existing rows
public AddEditMasterTask(int pkMTaskID)
{
InitializeMyForm();
// Title
lblDialogTitle.Text = "Add/Edit Master Task";
// Filter
bsMTask.Filter = "pkMTaskID = " + pkMTaskID;
// Populate form
taMTask.Fill(dataSetHipAdmin.MTask);
}
// First record when there is none to start with
public AddEditMasterTask()
{
InitializeMyForm();
// Title
lblDialogTitle.Text = "New Master Task";
// Populate form
taMTask.Fill(dataSetHipAdmin.MTask);
// Indicate that this is the first record
_blnIsFirstRecordInDgv = true;
}
private void InitializeMyForm()
{
_blnFormLoading = true;
InitializeComponent();
// form title
this.Text = "";
// Populate dropdowns
taPhase.Fill(dataSetHipAdmin.Phase);
taMeasureDim.Fill(dataSetHipAdmin.MeasureDim);
taMeasureUnit.Fill(dataSetHipAdmin.MeasureUnit);
// Disable Save button
this.btnSave.Enabled = false;
// Indicate that the form is no longer loading
// this controls behavior of events
_blnFormLoading = false;
}
#endregion
#region [ Enable button(s) after form load
public void EditsBegun(object sender, EventArgs e)
{
// Change buttons after edits begin
if (!_blnFormLoading)
this.btnSave.Enabled = true;
}
#endregion
#region [ Buttons
private void btnNew_Click(object sender, EventArgs e)
{
// Clear the current record
this.bsMTask.AddNew();
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordAdded;
}
private void btnDelete_Click(object sender, EventArgs e)
{
// MessageBox attributes
string message = "Are you sure you want to permanaently remove
this record?";
string caption = "Confirmation window";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
// Displays MessageBox
result = MessageBox.Show(message, caption, buttons);
// Delete
if (result == System.Windows.Forms.DialogResult.Yes)
{
// Apply pending changes to the underlying data source
this.bsMTask.RemoveAt(0);
// Send changes back to the database
this.taMTask.Update(dataSetHipAdmin.MTask);
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordDeleted;
}
else
{
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordViewedOnly;
}
// Close
this.Close();
}
private void btnSave_Click(object sender, EventArgs e)
{
// Take care of loose ends and time stamp
if (contractorCommentsTextBox.Text == "")
{
this.contractorCommentsTextBox.Text = "No notes.";
}
// Populate dateTimePicker with now
this.modifiedDateDateTimePicker.Value = DateTime.Now;
// Apply pending changes to the underlying data source
bsMTask.EndEdit(); /////// < Here is the error 'fkMeasureUnitID'
// Send changes back to the database
taMTask.Update(dataSetHipAdmin.MTask);
// Was "New" the previous button click?
if (CreateConfigureMasterTasks.dgvRecordActionState ==
CreateConfigureMasterTasks.dgvRcdAction.RecordAdded)
{
// If RecordAdded then keep the setting RecordAdded
}
else
{
// Otherwise this is an Edit
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordEdited;
}
// Close
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
// Close without saving
bsMTask.CancelEdit();
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordViewedOnly;
// Close
this.Close();
}
#endregion
}
}
=== end of user code ===
=== start of partial class ===
namespace HIP2007
{
partial class AddEditMasterTask
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.Label pkMTaskIDLabel;
System.Windows.Forms.Label descriptionLabel;
System.Windows.Forms.Label baseTimeLabel;
System.Windows.Forms.Label allowParticipationLabel;
System.Windows.Forms.Label allowQuantityLabel;
System.Windows.Forms.Label ordLabel;
System.Windows.Forms.Label configuredDisplayLabel;
System.Windows.Forms.Label contractorCommentsLabel;
System.Windows.Forms.Label modifiedDateLabel;
System.Windows.Forms.Label fkMeasureDimIDLabel;
System.Windows.Forms.Label fkMeasureUnitIDLabel;
System.Windows.Forms.Label fkPhaseIDLabel1;
this.dataSetHipAdmin = new HIPAdminAccess.DataSetHipAdmin();
this.bsMTask = new
System.Windows.Forms.BindingSource(this.components);
this.pkMTaskIDTextBox = new System.Windows.Forms.TextBox();
this.descriptionTextBox = new System.Windows.Forms.TextBox();
this.baseTimeTextBox = new System.Windows.Forms.TextBox();
this.allowParticipationCheckBox = new
System.Windows.Forms.CheckBox();
this.allowQuantityCheckBox = new
System.Windows.Forms.CheckBox();
this.ordTextBox = new System.Windows.Forms.TextBox();
this.configuredDisplayCheckBox = new
System.Windows.Forms.CheckBox();
this.contractorCommentsTextBox = new
System.Windows.Forms.TextBox();
this.modifiedDateDateTimePicker = new
System.Windows.Forms.DateTimePicker();
this.taMTask = new
HIPAdminAccess.DataSetHipAdminTableAdapters.MTaskTableAdapter();
this.taMeasureUnit = new
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureUnitTableAdapter();
this.taMeasureDim = new
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureDimTableAdapter();
this.bsMeasureDim = new
System.Windows.Forms.BindingSource(this.components);
this.bsMeasureUnit = new
System.Windows.Forms.BindingSource(this.components);
this.fkMeasureDimIDComboBox = new
System.Windows.Forms.ComboBox();
this.fkMeasureUnitIDComboBox = new
System.Windows.Forms.ComboBox();
this.toolTip1 = new
System.Windows.Forms.ToolTip(this.components);
this.fkPhaseIDComboBox = new System.Windows.Forms.ComboBox();
this.bsPhase = new
System.Windows.Forms.BindingSource(this.components);
this.taPhase = new
HIPAdminAccess.DataSetHipAdminTableAdapters.PhaseTableAdapter();
pkMTaskIDLabel = new System.Windows.Forms.Label();
descriptionLabel = new System.Windows.Forms.Label();
baseTimeLabel = new System.Windows.Forms.Label();
allowParticipationLabel = new System.Windows.Forms.Label();
allowQuantityLabel = new System.Windows.Forms.Label();
ordLabel = new System.Windows.Forms.Label();
configuredDisplayLabel = new System.Windows.Forms.Label();
contractorCommentsLabel = new System.Windows.Forms.Label();
modifiedDateLabel = new System.Windows.Forms.Label();
fkMeasureDimIDLabel = new System.Windows.Forms.Label();
fkMeasureUnitIDLabel = new System.Windows.Forms.Label();
fkPhaseIDLabel1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataSetHipAdmin)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsMTask)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureDim)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureUnit)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsPhase)).BeginInit();
this.SuspendLayout();
//
// lblDialogTitle
//
this.lblDialogTitle.TabIndex = 1;
//
// btnNew
//
this.btnNew.Location = new System.Drawing.Point(282, 421);
this.btnNew.TabIndex = 27;
this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(363, 421);
this.btnDelete.TabIndex = 28;
this.btnDelete.Click += new
System.EventHandler(this.btnDelete_Click);
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(444, 421);
this.btnSave.TabIndex = 26;
this.btnSave.Click += new
System.EventHandler(this.btnSave_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(525, 421);
this.btnCancel.TabIndex = 0;
this.btnCancel.Click += new
System.EventHandler(this.btnCancel_Click);
//
// pkMTaskIDLabel
//
pkMTaskIDLabel.AutoSize = true;
pkMTaskIDLabel.Location = new System.Drawing.Point(12, 45);
pkMTaskIDLabel.Name = "pkMTaskIDLabel";
pkMTaskIDLabel.Size = new System.Drawing.Size(72, 13);
pkMTaskIDLabel.TabIndex = 2;
pkMTaskIDLabel.Text = "pk MTask ID:";
pkMTaskIDLabel.Visible = false;
//
// descriptionLabel
//
descriptionLabel.AutoSize = true;
descriptionLabel.Location = new System.Drawing.Point(12, 97);
descriptionLabel.Name = "descriptionLabel";
descriptionLabel.Size = new System.Drawing.Size(63, 13);
descriptionLabel.TabIndex = 6;
descriptionLabel.Text = "Description:";
//
// baseTimeLabel
//
baseTimeLabel.AutoSize = true;
baseTimeLabel.Location = new System.Drawing.Point(12, 175);
baseTimeLabel.Name = "baseTimeLabel";
baseTimeLabel.Size = new System.Drawing.Size(60, 13);
baseTimeLabel.TabIndex = 12;
baseTimeLabel.Text = "Base Time:";
//
// allowParticipationLabel
//
allowParticipationLabel.AutoSize = true;
allowParticipationLabel.Location = new System.Drawing.Point(12,
203);
allowParticipationLabel.Name = "allowParticipationLabel";
allowParticipationLabel.Size = new System.Drawing.Size(96, 13);
allowParticipationLabel.TabIndex = 14;
allowParticipationLabel.Text = "Allow Participation:";
//
// allowQuantityLabel
//
allowQuantityLabel.AutoSize = true;
allowQuantityLabel.Location = new System.Drawing.Point(12, 233);
allowQuantityLabel.Name = "allowQuantityLabel";
allowQuantityLabel.Size = new System.Drawing.Size(77, 13);
allowQuantityLabel.TabIndex = 16;
allowQuantityLabel.Text = "Allow Quantity:";
//
// ordLabel
//
ordLabel.AutoSize = true;
ordLabel.Location = new System.Drawing.Point(13, 261);
ordLabel.Name = "ordLabel";
ordLabel.Size = new System.Drawing.Size(27, 13);
ordLabel.TabIndex = 18;
ordLabel.Text = "Ord:";
//
// configuredDisplayLabel
//
configuredDisplayLabel.AutoSize = true;
configuredDisplayLabel.Location = new System.Drawing.Point(12,
289);
configuredDisplayLabel.Name = "configuredDisplayLabel";
configuredDisplayLabel.Size = new System.Drawing.Size(98, 13);
configuredDisplayLabel.TabIndex = 20;
configuredDisplayLabel.Text = "Configured Display:";
//
// contractorCommentsLabel
//
contractorCommentsLabel.AutoSize = true;
contractorCommentsLabel.Location = new System.Drawing.Point(12,
317);
contractorCommentsLabel.Name = "contractorCommentsLabel";
contractorCommentsLabel.Size = new System.Drawing.Size(111, 13);
contractorCommentsLabel.TabIndex = 22;
contractorCommentsLabel.Text = "Contractor Comments:";
//
// modifiedDateLabel
//
modifiedDateLabel.AutoSize = true;
modifiedDateLabel.Location = new System.Drawing.Point(12, 370);
modifiedDateLabel.Name = "modifiedDateLabel";
modifiedDateLabel.Size = new System.Drawing.Size(76, 13);
modifiedDateLabel.TabIndex = 24;
modifiedDateLabel.Text = "Modified Date:";
//
// fkMeasureDimIDLabel
//
fkMeasureDimIDLabel.AutoSize = true;
fkMeasureDimIDLabel.Location = new System.Drawing.Point(12,
123);
fkMeasureDimIDLabel.Name = "fkMeasureDimIDLabel";
fkMeasureDimIDLabel.Size = new System.Drawing.Size(59, 13);
fkMeasureDimIDLabel.TabIndex = 8;
fkMeasureDimIDLabel.Text = "Dimension:";
//
// fkMeasureUnitIDLabel
//
fkMeasureUnitIDLabel.AutoSize = true;
fkMeasureUnitIDLabel.Location = new System.Drawing.Point(11,
149);
fkMeasureUnitIDLabel.Name = "fkMeasureUnitIDLabel";
fkMeasureUnitIDLabel.Size = new System.Drawing.Size(29, 13);
fkMeasureUnitIDLabel.TabIndex = 10;
fkMeasureUnitIDLabel.Text = "Unit:";
//
// fkPhaseIDLabel1
//
fkPhaseIDLabel1.AutoSize = true;
fkPhaseIDLabel1.Location = new System.Drawing.Point(12, 71);
fkPhaseIDLabel1.Name = "fkPhaseIDLabel1";
fkPhaseIDLabel1.Size = new System.Drawing.Size(40, 13);
fkPhaseIDLabel1.TabIndex = 4;
fkPhaseIDLabel1.Text = "Phase:";
//
// dataSetHipAdmin
//
this.dataSetHipAdmin.DataSetName = "DataSetHipAdmin";
this.dataSetHipAdmin.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema;
//
// bsMTask
//
this.bsMTask.DataMember = "MTask";
this.bsMTask.DataSource = this.dataSetHipAdmin;
//
// pkMTaskIDTextBox
//
this.pkMTaskIDTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "pkMTaskID", true));
this.pkMTaskIDTextBox.Location = new System.Drawing.Point(129,
42);
this.pkMTaskIDTextBox.Name = "pkMTaskIDTextBox";
this.pkMTaskIDTextBox.Size = new System.Drawing.Size(200, 20);
this.pkMTaskIDTextBox.TabIndex = 3;
this.pkMTaskIDTextBox.Visible = false;
//
// descriptionTextBox
//
this.descriptionTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "Description", true));
this.descriptionTextBox.Location = new System.Drawing.Point(129,
95);
this.descriptionTextBox.Name = "descriptionTextBox";
this.descriptionTextBox.Size = new System.Drawing.Size(400, 20);
this.descriptionTextBox.TabIndex = 7;
this.descriptionTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// baseTimeTextBox
//
this.baseTimeTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "BaseTime", true));
this.baseTimeTextBox.Location = new System.Drawing.Point(129,
172);
this.baseTimeTextBox.Name = "baseTimeTextBox";
this.baseTimeTextBox.Size = new System.Drawing.Size(50, 20);
this.baseTimeTextBox.TabIndex = 13;
this.toolTip1.SetToolTip(this.baseTimeTextBox, "The time for
each unit of dimensional unit.");
this.baseTimeTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// allowParticipationCheckBox
//
this.allowParticipationCheckBox.DataBindings.Add(new
System.Windows.Forms.Binding("CheckState", this.bsMTask,
"AllowParticipation", true));
this.allowParticipationCheckBox.Location = new
System.Drawing.Point(129, 198);
this.allowParticipationCheckBox.Name =
"allowParticipationCheckBox";
this.allowParticipationCheckBox.Size = new
System.Drawing.Size(50, 24);
this.allowParticipationCheckBox.TabIndex = 15;
this.allowParticipationCheckBox.CheckedChanged += new
System.EventHandler(this.EditsBegun);
//
// allowQuantityCheckBox
//
this.allowQuantityCheckBox.DataBindings.Add(new
System.Windows.Forms.Binding("CheckState", this.bsMTask, "AllowQuantity",
true));
this.allowQuantityCheckBox.Location = new
System.Drawing.Point(129, 228);
this.allowQuantityCheckBox.Name = "allowQuantityCheckBox";
this.allowQuantityCheckBox.Size = new System.Drawing.Size(50,
24);
this.allowQuantityCheckBox.TabIndex = 17;
this.allowQuantityCheckBox.CheckedChanged += new
System.EventHandler(this.EditsBegun);
//
// ordTextBox
//
this.ordTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "Ord", true));
this.ordTextBox.Location = new System.Drawing.Point(129, 258);
this.ordTextBox.Name = "ordTextBox";
this.ordTextBox.Size = new System.Drawing.Size(50, 20);
this.ordTextBox.TabIndex = 19;
this.toolTip1.SetToolTip(this.ordTextBox, "The order in which
this task appears within the same phase.");
this.ordTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// configuredDisplayCheckBox
//
this.configuredDisplayCheckBox.DataBindings.Add(new
System.Windows.Forms.Binding("CheckState", this.bsMTask,
"ConfiguredDisplay", true));
this.configuredDisplayCheckBox.Location = new
System.Drawing.Point(129, 284);
this.configuredDisplayCheckBox.Name =
"configuredDisplayCheckBox";
this.configuredDisplayCheckBox.Size = new
System.Drawing.Size(50, 24);
this.configuredDisplayCheckBox.TabIndex = 21;
this.configuredDisplayCheckBox.CheckedChanged += new
System.EventHandler(this.EditsBegun);
//
// contractorCommentsTextBox
//
this.contractorCommentsTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "ContractorComments",
true));
this.contractorCommentsTextBox.Location = new
System.Drawing.Point(129, 314);
this.contractorCommentsTextBox.Multiline = true;
this.contractorCommentsTextBox.Name =
"contractorCommentsTextBox";
this.contractorCommentsTextBox.Size = new
System.Drawing.Size(400, 46);
this.contractorCommentsTextBox.TabIndex = 23;
this.contractorCommentsTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// modifiedDateDateTimePicker
//
this.modifiedDateDateTimePicker.DataBindings.Add(new
System.Windows.Forms.Binding("Value", this.bsMTask, "ModifiedDate", true));
this.modifiedDateDateTimePicker.Enabled = false;
this.modifiedDateDateTimePicker.Location = new
System.Drawing.Point(129, 366);
this.modifiedDateDateTimePicker.Name =
"modifiedDateDateTimePicker";
this.modifiedDateDateTimePicker.Size = new
System.Drawing.Size(200, 20);
this.modifiedDateDateTimePicker.TabIndex = 25;
//
// taMTask
//
this.taMTask.ClearBeforeFill = true;
//
// taMeasureUnit
//
this.taMeasureUnit.ClearBeforeFill = true;
//
// taMeasureDim
//
this.taMeasureDim.ClearBeforeFill = true;
//
// bsMeasureDim
//
this.bsMeasureDim.DataMember = "MeasureDim";
this.bsMeasureDim.DataSource = this.dataSetHipAdmin;
this.bsMeasureDim.Sort = "ord";
//
// bsMeasureUnit
//
this.bsMeasureUnit.DataMember = "FK_MeasureUnit_MeasureDim";
this.bsMeasureUnit.DataSource = this.bsMeasureDim;
this.bsMeasureUnit.Sort = "ord";
//
// fkMeasureDimIDComboBox
//
this.fkMeasureDimIDComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("SelectedValue", this.bsMTask,
"fkMeasureDimID", true));
this.fkMeasureDimIDComboBox.DataSource = this.bsMeasureDim;
this.fkMeasureDimIDComboBox.DisplayMember = "Dimension";
this.fkMeasureDimIDComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fkMeasureDimIDComboBox.FormattingEnabled = true;
this.fkMeasureDimIDComboBox.Location = new
System.Drawing.Point(129, 120);
this.fkMeasureDimIDComboBox.Name = "fkMeasureDimIDComboBox";
this.fkMeasureDimIDComboBox.Size = new System.Drawing.Size(200,
21);
this.fkMeasureDimIDComboBox.TabIndex = 9;
this.fkMeasureDimIDComboBox.ValueMember = "pkMeasureDimID";
this.fkMeasureDimIDComboBox.SelectedValueChanged += new
System.EventHandler(this.EditsBegun);
//
// fkMeasureUnitIDComboBox
//
this.fkMeasureUnitIDComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("SelectedValue", this.bsMTask,
"fkMeasureUnitID", true));
this.fkMeasureUnitIDComboBox.DataSource = this.bsMeasureUnit;
this.fkMeasureUnitIDComboBox.DisplayMember = "Unit";
this.fkMeasureUnitIDComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fkMeasureUnitIDComboBox.FormattingEnabled = true;
this.fkMeasureUnitIDComboBox.Location = new
System.Drawing.Point(129, 146);
this.fkMeasureUnitIDComboBox.Name = "fkMeasureUnitIDComboBox";
this.fkMeasureUnitIDComboBox.Size = new System.Drawing.Size(200,
21);
this.fkMeasureUnitIDComboBox.TabIndex = 11;
this.fkMeasureUnitIDComboBox.ValueMember = "pkMeasureUnitID";
this.fkMeasureUnitIDComboBox.SelectedValueChanged += new
System.EventHandler(this.EditsBegun);
//
// fkPhaseIDComboBox
//
this.fkPhaseIDComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("SelectedValue", this.bsMTask, "fkPhaseID",
true));
this.fkPhaseIDComboBox.DataSource = this.bsPhase;
this.fkPhaseIDComboBox.DisplayMember = "Phase";
this.fkPhaseIDComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fkPhaseIDComboBox.FormattingEnabled = true;
this.fkPhaseIDComboBox.Location = new System.Drawing.Point(129,
68);
this.fkPhaseIDComboBox.Name = "fkPhaseIDComboBox";
this.fkPhaseIDComboBox.Size = new System.Drawing.Size(200, 21);
this.fkPhaseIDComboBox.TabIndex = 5;
this.fkPhaseIDComboBox.ValueMember = "pkPhaseID";
this.fkPhaseIDComboBox.SelectedValueChanged += new
System.EventHandler(this.EditsBegun);
//
// bsPhase
//
this.bsPhase.DataMember = "Phase";
this.bsPhase.DataSource = this.dataSetHipAdmin;
this.bsPhase.Sort = "ord";
//
// taPhase
//
this.taPhase.ClearBeforeFill = true;
//
// AddEditMasterTask
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(612, 456);
this.Controls.Add(fkPhaseIDLabel1);
this.Controls.Add(this.fkPhaseIDComboBox);
this.Controls.Add(fkMeasureUnitIDLabel);
this.Controls.Add(this.fkMeasureUnitIDComboBox);
this.Controls.Add(fkMeasureDimIDLabel);
this.Controls.Add(this.fkMeasureDimIDComboBox);
this.Controls.Add(pkMTaskIDLabel);
this.Controls.Add(this.pkMTaskIDTextBox);
this.Controls.Add(descriptionLabel);
this.Controls.Add(this.descriptionTextBox);
this.Controls.Add(baseTimeLabel);
this.Controls.Add(this.baseTimeTextBox);
this.Controls.Add(allowParticipationLabel);
this.Controls.Add(this.allowParticipationCheckBox);
this.Controls.Add(allowQuantityLabel);
this.Controls.Add(this.allowQuantityCheckBox);
this.Controls.Add(ordLabel);
this.Controls.Add(this.ordTextBox);
this.Controls.Add(configuredDisplayLabel);
this.Controls.Add(this.configuredDisplayCheckBox);
this.Controls.Add(contractorCommentsLabel);
this.Controls.Add(this.contractorCommentsTextBox);
this.Controls.Add(modifiedDateLabel);
this.Controls.Add(this.modifiedDateDateTimePicker);
this.Name = "AddEditMasterTask";
this.Text = "AddEditMTask";
this.Controls.SetChildIndex(this.btnNew, 0);
this.Controls.SetChildIndex(this.btnDelete, 0);
this.Controls.SetChildIndex(this.btnSave, 0);
this.Controls.SetChildIndex(this.btnCancel, 0);
this.Controls.SetChildIndex(this.lblDialogTitle, 0);
this.Controls.SetChildIndex(this.modifiedDateDateTimePicker, 0);
this.Controls.SetChildIndex(modifiedDateLabel, 0);
this.Controls.SetChildIndex(this.contractorCommentsTextBox, 0);
this.Controls.SetChildIndex(contractorCommentsLabel, 0);
this.Controls.SetChildIndex(this.configuredDisplayCheckBox, 0);
this.Controls.SetChildIndex(configuredDisplayLabel, 0);
this.Controls.SetChildIndex(this.ordTextBox, 0);
this.Controls.SetChildIndex(ordLabel, 0);
this.Controls.SetChildIndex(this.allowQuantityCheckBox, 0);
this.Controls.SetChildIndex(allowQuantityLabel, 0);
this.Controls.SetChildIndex(this.allowParticipationCheckBox, 0);
this.Controls.SetChildIndex(allowParticipationLabel, 0);
this.Controls.SetChildIndex(this.baseTimeTextBox, 0);
this.Controls.SetChildIndex(baseTimeLabel, 0);
this.Controls.SetChildIndex(this.descriptionTextBox, 0);
this.Controls.SetChildIndex(descriptionLabel, 0);
this.Controls.SetChildIndex(this.pkMTaskIDTextBox, 0);
this.Controls.SetChildIndex(pkMTaskIDLabel, 0);
this.Controls.SetChildIndex(this.fkMeasureDimIDComboBox, 0);
this.Controls.SetChildIndex(fkMeasureDimIDLabel, 0);
this.Controls.SetChildIndex(this.fkMeasureUnitIDComboBox, 0);
this.Controls.SetChildIndex(fkMeasureUnitIDLabel, 0);
this.Controls.SetChildIndex(this.fkPhaseIDComboBox, 0);
this.Controls.SetChildIndex(fkPhaseIDLabel1, 0);
((System.ComponentModel.ISupportInitialize)(this.dataSetHipAdmin)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsMTask)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureDim)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureUnit)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsPhase)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private HIPAdminAccess.DataSetHipAdmin dataSetHipAdmin;
private System.Windows.Forms.BindingSource bsMTask;
private System.Windows.Forms.TextBox pkMTaskIDTextBox;
private System.Windows.Forms.TextBox descriptionTextBox;
private System.Windows.Forms.TextBox baseTimeTextBox;
private System.Windows.Forms.CheckBox allowParticipationCheckBox;
private System.Windows.Forms.CheckBox allowQuantityCheckBox;
private System.Windows.Forms.TextBox ordTextBox;
private System.Windows.Forms.CheckBox configuredDisplayCheckBox;
private System.Windows.Forms.TextBox contractorCommentsTextBox;
private System.Windows.Forms.DateTimePicker
modifiedDateDateTimePicker;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.MTaskTableAdapter taMTask;
private System.Windows.Forms.BindingSource bsMeasureDim;
private System.Windows.Forms.BindingSource bsMeasureUnit;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureUnitTableAdapter
taMeasureUnit;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureDimTableAdapter
taMeasureDim;
private System.Windows.Forms.ComboBox fkMeasureDimIDComboBox;
private System.Windows.Forms.ComboBox fkMeasureUnitIDComboBox;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ComboBox fkPhaseIDComboBox;
private System.Windows.Forms.BindingSource bsPhase;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.PhaseTableAdapter taPhase;
}
}
=== end of partial class ===
Thank you
I have encoutered the error show below after attempting to save a new
record. This happens about 90% of the time under a set of conditions
described later below.
The main form contains a dataGridView and a button on that form opens a data
entry form performs edits or deletes on the record selected or provisions
the form for adding a new record when a button for that purpose is clicked.
This error below happens under a special circumstance that has something to
do with what I describe next.
I have two dropdowns on the data entry form. These dropdowns are linked by a
binding source relationship (and a relationship in the xsd). Because of this
relationship when a selection is made in the first dropdown it filters the
possible selections in the second dropdown.
The first dropdown selects the dimension (i.e. linear, area, volume) the
second selects the unit of measure (inch, foot, inch^2, foot^2...)
When the user makes a selection in the first dropdown (for example liner),
the second dropdown displays the first possible item without actually
selecting the dropdown (in this instance inch), an error will be thrown.
(Note the second dropdown does display the value.)
Why doesn't the form accept the displayed value in the second dropdown? Is
there a work around?
Below the error text and two sections of code; user code and partial class
for the form
==== the error text ====
System.Data.NoNullAllowedException was unhandled
Message="Column 'fkMeasureUnitID' does not allow nulls."
Source="System.Data"
StackTrace:
at System.Data.DataColumn.CheckNullable(DataRow row)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs
args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32
proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position,
Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID,
Int32 pos, Boolean fireEvent)
at System.Data.DataView.FinishAddNew(Int32 currentIndex, Boolean
success)
at System.Data.DataRowView.EndEdit()
at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
at System.Windows.Forms.BindingSource.EndEdit()
at HIP2007.AddEditMasterTask.btnSave_Click(Object sender, EventArgs
e) in C:\HIP2007\HIP2007\CurrentWork\04_AddEditMasterTask.cs:line 145
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at
HIP2007.CreateConfigureMasterTasks.btnAddViewEditTasks_Click(Object sender,
EventArgs e) in
C:\HIP2007\HIP2007\CurrentWork\03_CreateConfigureMasterTasks.cs:line 77
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at HIP2007.Program.Main() in C:\HIP2007\HIP2007\Program.cs:line 19
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
=== end of the error text ===
=== use code ===
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace HIP2007
{
public partial class AddEditMasterTask : bsfAddEdit
{
// Avoid firing events during load
private bool _blnFormLoading = false;
// First record in Dgv or Edit
private bool _blnIsFirstRecordInDgv = false;
#region [ Constructors & InitializeMyForm
// Edit when existing rows
public AddEditMasterTask(int pkMTaskID)
{
InitializeMyForm();
// Title
lblDialogTitle.Text = "Add/Edit Master Task";
// Filter
bsMTask.Filter = "pkMTaskID = " + pkMTaskID;
// Populate form
taMTask.Fill(dataSetHipAdmin.MTask);
}
// First record when there is none to start with
public AddEditMasterTask()
{
InitializeMyForm();
// Title
lblDialogTitle.Text = "New Master Task";
// Populate form
taMTask.Fill(dataSetHipAdmin.MTask);
// Indicate that this is the first record
_blnIsFirstRecordInDgv = true;
}
private void InitializeMyForm()
{
_blnFormLoading = true;
InitializeComponent();
// form title
this.Text = "";
// Populate dropdowns
taPhase.Fill(dataSetHipAdmin.Phase);
taMeasureDim.Fill(dataSetHipAdmin.MeasureDim);
taMeasureUnit.Fill(dataSetHipAdmin.MeasureUnit);
// Disable Save button
this.btnSave.Enabled = false;
// Indicate that the form is no longer loading
// this controls behavior of events
_blnFormLoading = false;
}
#endregion
#region [ Enable button(s) after form load
public void EditsBegun(object sender, EventArgs e)
{
// Change buttons after edits begin
if (!_blnFormLoading)
this.btnSave.Enabled = true;
}
#endregion
#region [ Buttons
private void btnNew_Click(object sender, EventArgs e)
{
// Clear the current record
this.bsMTask.AddNew();
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordAdded;
}
private void btnDelete_Click(object sender, EventArgs e)
{
// MessageBox attributes
string message = "Are you sure you want to permanaently remove
this record?";
string caption = "Confirmation window";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
// Displays MessageBox
result = MessageBox.Show(message, caption, buttons);
// Delete
if (result == System.Windows.Forms.DialogResult.Yes)
{
// Apply pending changes to the underlying data source
this.bsMTask.RemoveAt(0);
// Send changes back to the database
this.taMTask.Update(dataSetHipAdmin.MTask);
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordDeleted;
}
else
{
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordViewedOnly;
}
// Close
this.Close();
}
private void btnSave_Click(object sender, EventArgs e)
{
// Take care of loose ends and time stamp
if (contractorCommentsTextBox.Text == "")
{
this.contractorCommentsTextBox.Text = "No notes.";
}
// Populate dateTimePicker with now
this.modifiedDateDateTimePicker.Value = DateTime.Now;
// Apply pending changes to the underlying data source
bsMTask.EndEdit(); /////// < Here is the error 'fkMeasureUnitID'
// Send changes back to the database
taMTask.Update(dataSetHipAdmin.MTask);
// Was "New" the previous button click?
if (CreateConfigureMasterTasks.dgvRecordActionState ==
CreateConfigureMasterTasks.dgvRcdAction.RecordAdded)
{
// If RecordAdded then keep the setting RecordAdded
}
else
{
// Otherwise this is an Edit
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordEdited;
}
// Close
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
// Close without saving
bsMTask.CancelEdit();
// Save state of the action performed
CreateConfigureMasterTasks.dgvRecordActionState =
CreateConfigureMasterTasks.dgvRcdAction.RecordViewedOnly;
// Close
this.Close();
}
#endregion
}
}
=== end of user code ===
=== start of partial class ===
namespace HIP2007
{
partial class AddEditMasterTask
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.Label pkMTaskIDLabel;
System.Windows.Forms.Label descriptionLabel;
System.Windows.Forms.Label baseTimeLabel;
System.Windows.Forms.Label allowParticipationLabel;
System.Windows.Forms.Label allowQuantityLabel;
System.Windows.Forms.Label ordLabel;
System.Windows.Forms.Label configuredDisplayLabel;
System.Windows.Forms.Label contractorCommentsLabel;
System.Windows.Forms.Label modifiedDateLabel;
System.Windows.Forms.Label fkMeasureDimIDLabel;
System.Windows.Forms.Label fkMeasureUnitIDLabel;
System.Windows.Forms.Label fkPhaseIDLabel1;
this.dataSetHipAdmin = new HIPAdminAccess.DataSetHipAdmin();
this.bsMTask = new
System.Windows.Forms.BindingSource(this.components);
this.pkMTaskIDTextBox = new System.Windows.Forms.TextBox();
this.descriptionTextBox = new System.Windows.Forms.TextBox();
this.baseTimeTextBox = new System.Windows.Forms.TextBox();
this.allowParticipationCheckBox = new
System.Windows.Forms.CheckBox();
this.allowQuantityCheckBox = new
System.Windows.Forms.CheckBox();
this.ordTextBox = new System.Windows.Forms.TextBox();
this.configuredDisplayCheckBox = new
System.Windows.Forms.CheckBox();
this.contractorCommentsTextBox = new
System.Windows.Forms.TextBox();
this.modifiedDateDateTimePicker = new
System.Windows.Forms.DateTimePicker();
this.taMTask = new
HIPAdminAccess.DataSetHipAdminTableAdapters.MTaskTableAdapter();
this.taMeasureUnit = new
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureUnitTableAdapter();
this.taMeasureDim = new
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureDimTableAdapter();
this.bsMeasureDim = new
System.Windows.Forms.BindingSource(this.components);
this.bsMeasureUnit = new
System.Windows.Forms.BindingSource(this.components);
this.fkMeasureDimIDComboBox = new
System.Windows.Forms.ComboBox();
this.fkMeasureUnitIDComboBox = new
System.Windows.Forms.ComboBox();
this.toolTip1 = new
System.Windows.Forms.ToolTip(this.components);
this.fkPhaseIDComboBox = new System.Windows.Forms.ComboBox();
this.bsPhase = new
System.Windows.Forms.BindingSource(this.components);
this.taPhase = new
HIPAdminAccess.DataSetHipAdminTableAdapters.PhaseTableAdapter();
pkMTaskIDLabel = new System.Windows.Forms.Label();
descriptionLabel = new System.Windows.Forms.Label();
baseTimeLabel = new System.Windows.Forms.Label();
allowParticipationLabel = new System.Windows.Forms.Label();
allowQuantityLabel = new System.Windows.Forms.Label();
ordLabel = new System.Windows.Forms.Label();
configuredDisplayLabel = new System.Windows.Forms.Label();
contractorCommentsLabel = new System.Windows.Forms.Label();
modifiedDateLabel = new System.Windows.Forms.Label();
fkMeasureDimIDLabel = new System.Windows.Forms.Label();
fkMeasureUnitIDLabel = new System.Windows.Forms.Label();
fkPhaseIDLabel1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataSetHipAdmin)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsMTask)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureDim)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureUnit)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsPhase)).BeginInit();
this.SuspendLayout();
//
// lblDialogTitle
//
this.lblDialogTitle.TabIndex = 1;
//
// btnNew
//
this.btnNew.Location = new System.Drawing.Point(282, 421);
this.btnNew.TabIndex = 27;
this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(363, 421);
this.btnDelete.TabIndex = 28;
this.btnDelete.Click += new
System.EventHandler(this.btnDelete_Click);
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(444, 421);
this.btnSave.TabIndex = 26;
this.btnSave.Click += new
System.EventHandler(this.btnSave_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(525, 421);
this.btnCancel.TabIndex = 0;
this.btnCancel.Click += new
System.EventHandler(this.btnCancel_Click);
//
// pkMTaskIDLabel
//
pkMTaskIDLabel.AutoSize = true;
pkMTaskIDLabel.Location = new System.Drawing.Point(12, 45);
pkMTaskIDLabel.Name = "pkMTaskIDLabel";
pkMTaskIDLabel.Size = new System.Drawing.Size(72, 13);
pkMTaskIDLabel.TabIndex = 2;
pkMTaskIDLabel.Text = "pk MTask ID:";
pkMTaskIDLabel.Visible = false;
//
// descriptionLabel
//
descriptionLabel.AutoSize = true;
descriptionLabel.Location = new System.Drawing.Point(12, 97);
descriptionLabel.Name = "descriptionLabel";
descriptionLabel.Size = new System.Drawing.Size(63, 13);
descriptionLabel.TabIndex = 6;
descriptionLabel.Text = "Description:";
//
// baseTimeLabel
//
baseTimeLabel.AutoSize = true;
baseTimeLabel.Location = new System.Drawing.Point(12, 175);
baseTimeLabel.Name = "baseTimeLabel";
baseTimeLabel.Size = new System.Drawing.Size(60, 13);
baseTimeLabel.TabIndex = 12;
baseTimeLabel.Text = "Base Time:";
//
// allowParticipationLabel
//
allowParticipationLabel.AutoSize = true;
allowParticipationLabel.Location = new System.Drawing.Point(12,
203);
allowParticipationLabel.Name = "allowParticipationLabel";
allowParticipationLabel.Size = new System.Drawing.Size(96, 13);
allowParticipationLabel.TabIndex = 14;
allowParticipationLabel.Text = "Allow Participation:";
//
// allowQuantityLabel
//
allowQuantityLabel.AutoSize = true;
allowQuantityLabel.Location = new System.Drawing.Point(12, 233);
allowQuantityLabel.Name = "allowQuantityLabel";
allowQuantityLabel.Size = new System.Drawing.Size(77, 13);
allowQuantityLabel.TabIndex = 16;
allowQuantityLabel.Text = "Allow Quantity:";
//
// ordLabel
//
ordLabel.AutoSize = true;
ordLabel.Location = new System.Drawing.Point(13, 261);
ordLabel.Name = "ordLabel";
ordLabel.Size = new System.Drawing.Size(27, 13);
ordLabel.TabIndex = 18;
ordLabel.Text = "Ord:";
//
// configuredDisplayLabel
//
configuredDisplayLabel.AutoSize = true;
configuredDisplayLabel.Location = new System.Drawing.Point(12,
289);
configuredDisplayLabel.Name = "configuredDisplayLabel";
configuredDisplayLabel.Size = new System.Drawing.Size(98, 13);
configuredDisplayLabel.TabIndex = 20;
configuredDisplayLabel.Text = "Configured Display:";
//
// contractorCommentsLabel
//
contractorCommentsLabel.AutoSize = true;
contractorCommentsLabel.Location = new System.Drawing.Point(12,
317);
contractorCommentsLabel.Name = "contractorCommentsLabel";
contractorCommentsLabel.Size = new System.Drawing.Size(111, 13);
contractorCommentsLabel.TabIndex = 22;
contractorCommentsLabel.Text = "Contractor Comments:";
//
// modifiedDateLabel
//
modifiedDateLabel.AutoSize = true;
modifiedDateLabel.Location = new System.Drawing.Point(12, 370);
modifiedDateLabel.Name = "modifiedDateLabel";
modifiedDateLabel.Size = new System.Drawing.Size(76, 13);
modifiedDateLabel.TabIndex = 24;
modifiedDateLabel.Text = "Modified Date:";
//
// fkMeasureDimIDLabel
//
fkMeasureDimIDLabel.AutoSize = true;
fkMeasureDimIDLabel.Location = new System.Drawing.Point(12,
123);
fkMeasureDimIDLabel.Name = "fkMeasureDimIDLabel";
fkMeasureDimIDLabel.Size = new System.Drawing.Size(59, 13);
fkMeasureDimIDLabel.TabIndex = 8;
fkMeasureDimIDLabel.Text = "Dimension:";
//
// fkMeasureUnitIDLabel
//
fkMeasureUnitIDLabel.AutoSize = true;
fkMeasureUnitIDLabel.Location = new System.Drawing.Point(11,
149);
fkMeasureUnitIDLabel.Name = "fkMeasureUnitIDLabel";
fkMeasureUnitIDLabel.Size = new System.Drawing.Size(29, 13);
fkMeasureUnitIDLabel.TabIndex = 10;
fkMeasureUnitIDLabel.Text = "Unit:";
//
// fkPhaseIDLabel1
//
fkPhaseIDLabel1.AutoSize = true;
fkPhaseIDLabel1.Location = new System.Drawing.Point(12, 71);
fkPhaseIDLabel1.Name = "fkPhaseIDLabel1";
fkPhaseIDLabel1.Size = new System.Drawing.Size(40, 13);
fkPhaseIDLabel1.TabIndex = 4;
fkPhaseIDLabel1.Text = "Phase:";
//
// dataSetHipAdmin
//
this.dataSetHipAdmin.DataSetName = "DataSetHipAdmin";
this.dataSetHipAdmin.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema;
//
// bsMTask
//
this.bsMTask.DataMember = "MTask";
this.bsMTask.DataSource = this.dataSetHipAdmin;
//
// pkMTaskIDTextBox
//
this.pkMTaskIDTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "pkMTaskID", true));
this.pkMTaskIDTextBox.Location = new System.Drawing.Point(129,
42);
this.pkMTaskIDTextBox.Name = "pkMTaskIDTextBox";
this.pkMTaskIDTextBox.Size = new System.Drawing.Size(200, 20);
this.pkMTaskIDTextBox.TabIndex = 3;
this.pkMTaskIDTextBox.Visible = false;
//
// descriptionTextBox
//
this.descriptionTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "Description", true));
this.descriptionTextBox.Location = new System.Drawing.Point(129,
95);
this.descriptionTextBox.Name = "descriptionTextBox";
this.descriptionTextBox.Size = new System.Drawing.Size(400, 20);
this.descriptionTextBox.TabIndex = 7;
this.descriptionTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// baseTimeTextBox
//
this.baseTimeTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "BaseTime", true));
this.baseTimeTextBox.Location = new System.Drawing.Point(129,
172);
this.baseTimeTextBox.Name = "baseTimeTextBox";
this.baseTimeTextBox.Size = new System.Drawing.Size(50, 20);
this.baseTimeTextBox.TabIndex = 13;
this.toolTip1.SetToolTip(this.baseTimeTextBox, "The time for
each unit of dimensional unit.");
this.baseTimeTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// allowParticipationCheckBox
//
this.allowParticipationCheckBox.DataBindings.Add(new
System.Windows.Forms.Binding("CheckState", this.bsMTask,
"AllowParticipation", true));
this.allowParticipationCheckBox.Location = new
System.Drawing.Point(129, 198);
this.allowParticipationCheckBox.Name =
"allowParticipationCheckBox";
this.allowParticipationCheckBox.Size = new
System.Drawing.Size(50, 24);
this.allowParticipationCheckBox.TabIndex = 15;
this.allowParticipationCheckBox.CheckedChanged += new
System.EventHandler(this.EditsBegun);
//
// allowQuantityCheckBox
//
this.allowQuantityCheckBox.DataBindings.Add(new
System.Windows.Forms.Binding("CheckState", this.bsMTask, "AllowQuantity",
true));
this.allowQuantityCheckBox.Location = new
System.Drawing.Point(129, 228);
this.allowQuantityCheckBox.Name = "allowQuantityCheckBox";
this.allowQuantityCheckBox.Size = new System.Drawing.Size(50,
24);
this.allowQuantityCheckBox.TabIndex = 17;
this.allowQuantityCheckBox.CheckedChanged += new
System.EventHandler(this.EditsBegun);
//
// ordTextBox
//
this.ordTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "Ord", true));
this.ordTextBox.Location = new System.Drawing.Point(129, 258);
this.ordTextBox.Name = "ordTextBox";
this.ordTextBox.Size = new System.Drawing.Size(50, 20);
this.ordTextBox.TabIndex = 19;
this.toolTip1.SetToolTip(this.ordTextBox, "The order in which
this task appears within the same phase.");
this.ordTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// configuredDisplayCheckBox
//
this.configuredDisplayCheckBox.DataBindings.Add(new
System.Windows.Forms.Binding("CheckState", this.bsMTask,
"ConfiguredDisplay", true));
this.configuredDisplayCheckBox.Location = new
System.Drawing.Point(129, 284);
this.configuredDisplayCheckBox.Name =
"configuredDisplayCheckBox";
this.configuredDisplayCheckBox.Size = new
System.Drawing.Size(50, 24);
this.configuredDisplayCheckBox.TabIndex = 21;
this.configuredDisplayCheckBox.CheckedChanged += new
System.EventHandler(this.EditsBegun);
//
// contractorCommentsTextBox
//
this.contractorCommentsTextBox.DataBindings.Add(new
System.Windows.Forms.Binding("Text", this.bsMTask, "ContractorComments",
true));
this.contractorCommentsTextBox.Location = new
System.Drawing.Point(129, 314);
this.contractorCommentsTextBox.Multiline = true;
this.contractorCommentsTextBox.Name =
"contractorCommentsTextBox";
this.contractorCommentsTextBox.Size = new
System.Drawing.Size(400, 46);
this.contractorCommentsTextBox.TabIndex = 23;
this.contractorCommentsTextBox.TextChanged += new
System.EventHandler(this.EditsBegun);
//
// modifiedDateDateTimePicker
//
this.modifiedDateDateTimePicker.DataBindings.Add(new
System.Windows.Forms.Binding("Value", this.bsMTask, "ModifiedDate", true));
this.modifiedDateDateTimePicker.Enabled = false;
this.modifiedDateDateTimePicker.Location = new
System.Drawing.Point(129, 366);
this.modifiedDateDateTimePicker.Name =
"modifiedDateDateTimePicker";
this.modifiedDateDateTimePicker.Size = new
System.Drawing.Size(200, 20);
this.modifiedDateDateTimePicker.TabIndex = 25;
//
// taMTask
//
this.taMTask.ClearBeforeFill = true;
//
// taMeasureUnit
//
this.taMeasureUnit.ClearBeforeFill = true;
//
// taMeasureDim
//
this.taMeasureDim.ClearBeforeFill = true;
//
// bsMeasureDim
//
this.bsMeasureDim.DataMember = "MeasureDim";
this.bsMeasureDim.DataSource = this.dataSetHipAdmin;
this.bsMeasureDim.Sort = "ord";
//
// bsMeasureUnit
//
this.bsMeasureUnit.DataMember = "FK_MeasureUnit_MeasureDim";
this.bsMeasureUnit.DataSource = this.bsMeasureDim;
this.bsMeasureUnit.Sort = "ord";
//
// fkMeasureDimIDComboBox
//
this.fkMeasureDimIDComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("SelectedValue", this.bsMTask,
"fkMeasureDimID", true));
this.fkMeasureDimIDComboBox.DataSource = this.bsMeasureDim;
this.fkMeasureDimIDComboBox.DisplayMember = "Dimension";
this.fkMeasureDimIDComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fkMeasureDimIDComboBox.FormattingEnabled = true;
this.fkMeasureDimIDComboBox.Location = new
System.Drawing.Point(129, 120);
this.fkMeasureDimIDComboBox.Name = "fkMeasureDimIDComboBox";
this.fkMeasureDimIDComboBox.Size = new System.Drawing.Size(200,
21);
this.fkMeasureDimIDComboBox.TabIndex = 9;
this.fkMeasureDimIDComboBox.ValueMember = "pkMeasureDimID";
this.fkMeasureDimIDComboBox.SelectedValueChanged += new
System.EventHandler(this.EditsBegun);
//
// fkMeasureUnitIDComboBox
//
this.fkMeasureUnitIDComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("SelectedValue", this.bsMTask,
"fkMeasureUnitID", true));
this.fkMeasureUnitIDComboBox.DataSource = this.bsMeasureUnit;
this.fkMeasureUnitIDComboBox.DisplayMember = "Unit";
this.fkMeasureUnitIDComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fkMeasureUnitIDComboBox.FormattingEnabled = true;
this.fkMeasureUnitIDComboBox.Location = new
System.Drawing.Point(129, 146);
this.fkMeasureUnitIDComboBox.Name = "fkMeasureUnitIDComboBox";
this.fkMeasureUnitIDComboBox.Size = new System.Drawing.Size(200,
21);
this.fkMeasureUnitIDComboBox.TabIndex = 11;
this.fkMeasureUnitIDComboBox.ValueMember = "pkMeasureUnitID";
this.fkMeasureUnitIDComboBox.SelectedValueChanged += new
System.EventHandler(this.EditsBegun);
//
// fkPhaseIDComboBox
//
this.fkPhaseIDComboBox.DataBindings.Add(new
System.Windows.Forms.Binding("SelectedValue", this.bsMTask, "fkPhaseID",
true));
this.fkPhaseIDComboBox.DataSource = this.bsPhase;
this.fkPhaseIDComboBox.DisplayMember = "Phase";
this.fkPhaseIDComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fkPhaseIDComboBox.FormattingEnabled = true;
this.fkPhaseIDComboBox.Location = new System.Drawing.Point(129,
68);
this.fkPhaseIDComboBox.Name = "fkPhaseIDComboBox";
this.fkPhaseIDComboBox.Size = new System.Drawing.Size(200, 21);
this.fkPhaseIDComboBox.TabIndex = 5;
this.fkPhaseIDComboBox.ValueMember = "pkPhaseID";
this.fkPhaseIDComboBox.SelectedValueChanged += new
System.EventHandler(this.EditsBegun);
//
// bsPhase
//
this.bsPhase.DataMember = "Phase";
this.bsPhase.DataSource = this.dataSetHipAdmin;
this.bsPhase.Sort = "ord";
//
// taPhase
//
this.taPhase.ClearBeforeFill = true;
//
// AddEditMasterTask
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(612, 456);
this.Controls.Add(fkPhaseIDLabel1);
this.Controls.Add(this.fkPhaseIDComboBox);
this.Controls.Add(fkMeasureUnitIDLabel);
this.Controls.Add(this.fkMeasureUnitIDComboBox);
this.Controls.Add(fkMeasureDimIDLabel);
this.Controls.Add(this.fkMeasureDimIDComboBox);
this.Controls.Add(pkMTaskIDLabel);
this.Controls.Add(this.pkMTaskIDTextBox);
this.Controls.Add(descriptionLabel);
this.Controls.Add(this.descriptionTextBox);
this.Controls.Add(baseTimeLabel);
this.Controls.Add(this.baseTimeTextBox);
this.Controls.Add(allowParticipationLabel);
this.Controls.Add(this.allowParticipationCheckBox);
this.Controls.Add(allowQuantityLabel);
this.Controls.Add(this.allowQuantityCheckBox);
this.Controls.Add(ordLabel);
this.Controls.Add(this.ordTextBox);
this.Controls.Add(configuredDisplayLabel);
this.Controls.Add(this.configuredDisplayCheckBox);
this.Controls.Add(contractorCommentsLabel);
this.Controls.Add(this.contractorCommentsTextBox);
this.Controls.Add(modifiedDateLabel);
this.Controls.Add(this.modifiedDateDateTimePicker);
this.Name = "AddEditMasterTask";
this.Text = "AddEditMTask";
this.Controls.SetChildIndex(this.btnNew, 0);
this.Controls.SetChildIndex(this.btnDelete, 0);
this.Controls.SetChildIndex(this.btnSave, 0);
this.Controls.SetChildIndex(this.btnCancel, 0);
this.Controls.SetChildIndex(this.lblDialogTitle, 0);
this.Controls.SetChildIndex(this.modifiedDateDateTimePicker, 0);
this.Controls.SetChildIndex(modifiedDateLabel, 0);
this.Controls.SetChildIndex(this.contractorCommentsTextBox, 0);
this.Controls.SetChildIndex(contractorCommentsLabel, 0);
this.Controls.SetChildIndex(this.configuredDisplayCheckBox, 0);
this.Controls.SetChildIndex(configuredDisplayLabel, 0);
this.Controls.SetChildIndex(this.ordTextBox, 0);
this.Controls.SetChildIndex(ordLabel, 0);
this.Controls.SetChildIndex(this.allowQuantityCheckBox, 0);
this.Controls.SetChildIndex(allowQuantityLabel, 0);
this.Controls.SetChildIndex(this.allowParticipationCheckBox, 0);
this.Controls.SetChildIndex(allowParticipationLabel, 0);
this.Controls.SetChildIndex(this.baseTimeTextBox, 0);
this.Controls.SetChildIndex(baseTimeLabel, 0);
this.Controls.SetChildIndex(this.descriptionTextBox, 0);
this.Controls.SetChildIndex(descriptionLabel, 0);
this.Controls.SetChildIndex(this.pkMTaskIDTextBox, 0);
this.Controls.SetChildIndex(pkMTaskIDLabel, 0);
this.Controls.SetChildIndex(this.fkMeasureDimIDComboBox, 0);
this.Controls.SetChildIndex(fkMeasureDimIDLabel, 0);
this.Controls.SetChildIndex(this.fkMeasureUnitIDComboBox, 0);
this.Controls.SetChildIndex(fkMeasureUnitIDLabel, 0);
this.Controls.SetChildIndex(this.fkPhaseIDComboBox, 0);
this.Controls.SetChildIndex(fkPhaseIDLabel1, 0);
((System.ComponentModel.ISupportInitialize)(this.dataSetHipAdmin)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsMTask)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureDim)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsMeasureUnit)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsPhase)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private HIPAdminAccess.DataSetHipAdmin dataSetHipAdmin;
private System.Windows.Forms.BindingSource bsMTask;
private System.Windows.Forms.TextBox pkMTaskIDTextBox;
private System.Windows.Forms.TextBox descriptionTextBox;
private System.Windows.Forms.TextBox baseTimeTextBox;
private System.Windows.Forms.CheckBox allowParticipationCheckBox;
private System.Windows.Forms.CheckBox allowQuantityCheckBox;
private System.Windows.Forms.TextBox ordTextBox;
private System.Windows.Forms.CheckBox configuredDisplayCheckBox;
private System.Windows.Forms.TextBox contractorCommentsTextBox;
private System.Windows.Forms.DateTimePicker
modifiedDateDateTimePicker;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.MTaskTableAdapter taMTask;
private System.Windows.Forms.BindingSource bsMeasureDim;
private System.Windows.Forms.BindingSource bsMeasureUnit;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureUnitTableAdapter
taMeasureUnit;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.MeasureDimTableAdapter
taMeasureDim;
private System.Windows.Forms.ComboBox fkMeasureDimIDComboBox;
private System.Windows.Forms.ComboBox fkMeasureUnitIDComboBox;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ComboBox fkPhaseIDComboBox;
private System.Windows.Forms.BindingSource bsPhase;
private
HIPAdminAccess.DataSetHipAdminTableAdapters.PhaseTableAdapter taPhase;
}
}
=== end of partial class ===
Thank you