A
Assimalyst
Hi,
I declare an object, surgeonRow within an if statement:
if(addNewSurgeonChkBx.Checked == true)
{
DataRow surgeonRow = dsAddAssessment.Tables["Surgeon"].NewRow();
surgeonRow["sgnTitle"] = titleCboBx.SelectedValue;
surgeonRow["sgnFName"] = fNameTxtBx.Text;
surgeonRow["sgnLName"] = lNameTxtBx.Text;
surgeonRow["estNo"] = Session["establishment"].ToString();
dsAddAssessment.Tables["Surgeon"].Rows.Add(surgeonRow);
}
however when i try to use it again like this:
if(addNewSurgeonChkBx.Checked == true)
{
assessmentRow.SetParentRow(surgeonRow);
}
surgeonRow is highlighted and the build error "The name 'surgeonRow'
does not exist in the class or namespace" is given.
is there a way to reference it? I cant move the
DataRow surgeonRow = dsAddAssessment.Tables["Surgeon"].NewRow();
line out of the if statement to overcome this error, as it produces
more errors.
Thanks.
I declare an object, surgeonRow within an if statement:
if(addNewSurgeonChkBx.Checked == true)
{
DataRow surgeonRow = dsAddAssessment.Tables["Surgeon"].NewRow();
surgeonRow["sgnTitle"] = titleCboBx.SelectedValue;
surgeonRow["sgnFName"] = fNameTxtBx.Text;
surgeonRow["sgnLName"] = lNameTxtBx.Text;
surgeonRow["estNo"] = Session["establishment"].ToString();
dsAddAssessment.Tables["Surgeon"].Rows.Add(surgeonRow);
}
however when i try to use it again like this:
if(addNewSurgeonChkBx.Checked == true)
{
assessmentRow.SetParentRow(surgeonRow);
}
surgeonRow is highlighted and the build error "The name 'surgeonRow'
does not exist in the class or namespace" is given.
is there a way to reference it? I cant move the
DataRow surgeonRow = dsAddAssessment.Tables["Surgeon"].NewRow();
line out of the if statement to overcome this error, as it produces
more errors.
Thanks.