I have a TableAdapter generated by the Visual Studio dataset designer.
Owing to some fabulous coding by my illustrious predecessor, this stored function returns a mountain of data, and I'm trying to solve that problem, but in the meantime, the procedure is timing out because all of the data isn't returned by the time the connection is set to time out.
myProcedureTableAdapter.Adapter.SelectCommand
is null
at runtime, as are DeleteCommand
, InsertCommand
and UpdateCommand
. The variable I want is contained in myProcedureTableAdapter.CommandCollection[0]
, but that's protected.
How can I extend the timeout on this TableAdapter?
EDIT: I can actually run the Fill and GetData commands on the TableAdapter, so the select command obviously exists in some context (i.e. as a member of CommandCollection
), I just can't access that command via the SelectCommand
property.
EDIT2: Well, this is vexing. I've gone into the generated code and found the following:
Public Overloads Overridable Function GetData() As DataSet_myDataSet.myProcedureDataTable
Me.Adapter.SelectCommand = Me.CommandCollection(0)
This shows that the SelectCommand
isn't being set until I'm actually in the process of selecting stuff. This is insane.
I'm going to try creating a readonly
property in a partial class, and have that directly reference Me.CommandCollection(0)
. It's terrible coding practice, but I can't see any other option at this point.
I'll leave this question here in case someone comes along with a sane idea.