DataSet Row = null even after a successful FindByProgramID

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Any clue to why this newRow call sets "programSelected" to null no matter
what I have tried?

Further explanation, this function resides in a form2 which I have been able
to give access to form1's (MainWindowReference's) public or internal
elements. Also "programSelected" is an internal global variable declared like
so: internal testSQLDataSet.programRow programSelected;.



private void openToolStripButton_Click(object sender, EventArgs e)
{
// TODO: fix problem with the programSelected being set to null
MainWindowReference.programSelected =
testSQLdatabaseDataSet.Programs.FindByProgramID((Convert.ToInt32(this.programViewDataGridView[0,this.programViewDataGridView.CurrentRow.Index].EditedFormattedValue)));
this.Close();
}
 
Well, my first thought would be :
- FindProgramID doesn't return the row properly
- there is no match found...

IMO the problme would be in FindByProgramByID, check also your are looking
for the right key...
 
Thanks for your reply and sorry it took me so long to respond. I did check to
make sure the FindProgamID returns the correct type. I would hesitate to jump
to the conclusion the it simply has trouble returning a type. Also I do know
that I am trying to access keys that are indeed valid.
 
Are there any other suggestions that can be made, even perhaps a different
way of acomplishing the same tasks, which is explained in the second
paragraph of my original post?
 
Back
Top