InsertElement Example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestInsertElement()
{
   short nRet = 0;
   LEADDICOM1.EnableMethodErrors = false;
   //insert the new element
   LEADDICOM1.FindTag((int)LTDICLib.DicomDataSetTagConstants6.TAG_DISCHARGE_DATE);
   nRet = LEADDICOM1.InsertElement(false, (int)LTDICLib.DicomDataSetTagConstants6.TAG_DISCHARGE_DATE, LEADDICOM1.get_CurrentTag().VR, false, (int)LTDICLib.DicomMiscConstants.ELEMENT_INDEX_MAX);
   if (nRet != 0)
      MessageBox.Show("Error Inserting Element");
   LEADDICOM1.EnableMethodErrors = true;
}