G
Guest
So I’ve got this dataset that was built with the designer. All is well except
that the Select command needs to be generated at runtime for app-specific
reasons.
I thought I would do something clever, which was add a version of Fill() to
the dataset class that takes the SQL string as a parameter. But much to my
dismay, my designer-built dataset class is frequently rebuilt, presumably to
keep it in synch with changes to the table structure.
That’s actually quite a neat little feature but now I’m in a bind. The first
line in the generated TableAdapter’s Fill() does this:
this->Adapter->SelectCommand = this->CommandCollection[0];
Both CommandCollection and the underlying array _commandCollection are
private, as is the underlying SqlAdapter of my TableAdapter. Since I can’t
say CommandCollection[0]=this or Adapter->SelectCommand=that I’m at a bit of
a loss as to how I’m supposed to provide a Select statement at runtime.
Deriving yet another class from the generated TableAdapter whose sole purpose
is to override Fill() seems a little silly.
What am I missing here?
that the Select command needs to be generated at runtime for app-specific
reasons.
I thought I would do something clever, which was add a version of Fill() to
the dataset class that takes the SQL string as a parameter. But much to my
dismay, my designer-built dataset class is frequently rebuilt, presumably to
keep it in synch with changes to the table structure.
That’s actually quite a neat little feature but now I’m in a bind. The first
line in the generated TableAdapter’s Fill() does this:
this->Adapter->SelectCommand = this->CommandCollection[0];
Both CommandCollection and the underlying array _commandCollection are
private, as is the underlying SqlAdapter of my TableAdapter. Since I can’t
say CommandCollection[0]=this or Adapter->SelectCommand=that I’m at a bit of
a loss as to how I’m supposed to provide a Select statement at runtime.
Deriving yet another class from the generated TableAdapter whose sole purpose
is to override Fill() seems a little silly.
What am I missing here?