I am trying to get a new UD110A Record. I have a new UD110 record and that is working correctly. However, when I try to create a new UD110A I get the following error:
I would appreciate if someone can look at the code and help me out. I used the Wizard to add the code.
private void CallUD110AdapterGetaNewUD110aMethod()
{
try
{
// Declare and Initialize EpiDataView Variables
EpiDataView edvGS_PMS_110Update = ((EpiDataView)(this.oTrans.EpiDataViews["GS_PMS_110Update"]));
// Check if valid EpiDataView Row(s) are selected
if ((edvGS_PMS_110Update.Row < 0))
{
return;
}
// Declare and create an instance of the Adapter.
UD110Adapter adapterUD110 = new UD110Adapter(this.oTrans);
adapterUD110.BOConnect();
// Declare and Initialize Variables
// TODO: You may need to replace the default initialization with valid values as required for the BL method call.
string parentKey1 = "PMOPERATIONS";
string parentKey2 = tbTypeCode1.Value.ToString();
string parentKey3 = tbFreqCode1.Value.ToString();
string parentKey4 = tbEquipTypeID.Text;
string parentKey5 = string.Empty;
string Key1 = "PMOPERATIONS";
string Key2 = tbTypeCode1.Value.ToString();
string Key3 = tbFreqCode1.Value.ToString();
string Key4 = tbEquipTypeID.Text;
string Key5 = string.Empty;
string childKey1 = "OPERINSTRUCT";
string childKey2 = tbInstNum1.Text;
string childKey3 = string.Empty;
string childKey4 = string.Empty;
string childKey5 = string.Empty;
// Call Adapter method
bool result = adapterUD110.GetaNewUD110a(parentKey1, parentKey2, parentKey3, parentKey4, parentKey5);
adapterUD110.UD110Data.UD110A[0].ChildKey1 = childKey1;
adapterUD110.UD110Data.UD110A[0].ChildKey2 = childKey2;
adapterUD110.UD110Data.UD110A[0].ChildKey3 = childKey3;
adapterUD110.UD110Data.UD110A[0].Character01 = tbPMSpecialTools1.Text;
adapterUD110.UD110Data.UD110A[0].Character02 = tbPMInstruction1.Text;
adapterUD110.UD110Data.UD110A[0].CheckBox01 = epiCheckBox1.Checked;
// Cleanup Adapter Reference
adapterUD110.Update();
adapterUD110.Dispose();
} catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}
This is my UD110 code that is working and creating a new record:
{
try
{
string Key1 = "PMOPERATIONS";
string Key2 = tbTypeCode1.Value.ToString();
string Key3 = tbFreqCode1.Value.ToString();
string Key4 = tbEquipTypeID.Text;
string Key5 = string.Empty;
string childKey1 = "OPERINSTRUCT";
string childKey2 = tbInstNum1.Text;
string childKey3 = string.Empty;
string childKey4 = string.Empty;
string childKey5 = string.Empty;
// Declare and Initialize EpiDataView Variables
// Declare and create an instance of the Adapter.
UD110Adapter adapterUD110 = new UD110Adapter(this.oTrans);
adapterUD110.BOConnect();
// Call Adapter method
bool result = adapterUD110.GetaNewUD110();
adapterUD110.UD110Data.UD110[0].Key1 = Key1;
adapterUD110.UD110Data.UD110[0].Key2 = Key2;
adapterUD110.UD110Data.UD110[0].Key3 = Key3;
adapterUD110.UD110Data.UD110[0].Key4 = Key4;
adapterUD110.UD110Data.UD110[0].Key5 = Key5;
adapterUD110.Update();
// Cleanup Adapter Reference
adapterUD110.Dispose();
} catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}