Hi guys,
I wonder if any one may be able to help?
I have an issue with a SqlCommand object that when it executes a stored procedure that returns no records, will timeout.
The stored procedure is not complicated, it is just a simple SELECT ColumnA, ColumnB, ... FROM TableA WHERE Id = @Id
type of thing. If I run the SP in Sql Managment Studio it returns in a flash.
However when I try to excecute the command to fill a DataAdapter, or execute the command manually from the "Immediate Window" - once it has been created and parameters populated, it will always timeout.
I use the SqlCommandBuilder's DeriveParameters() method to populate the SqCommand parameters,and then iterate through the collection and populate the values. I then set the DataAdapter.SelectCommand to a reference of the SqlCommand and call the DataAdapter's fill method.
The code seems to work fine with any SP that returns data, but baulks when no rows are returned.
Has any one experienced this, and can point me in the correct direction, please?
Thanks in advance, Regards, Duane.