Having some issues with ServicedComponents and opening connections with them to SQL Server database (v8 sp3). .NET Framework 1.1, Microsoft Development Environment 2003 version 7.1.088
It's a little complicated, but I'll try and simplify.
On my PC (Windows 2000), I write a component which creates a SQLSERVER connection to a SQL Server database (SQL1 on DevServer).
I am stepping through the code to debug it.
When the component is doing an insert, the connection is created and opened successfully, and the data is inserted.
However...
When the component is doing a read (into a datareader), the connection is created (I can see it in SQL Enterprise Manager-Management-Process Info), BUT the status of the connection never goes to "open" in the IDE Watch Window.
When I pause execution, I see that the connection.Open() line is showing "This code has called into another function. When that function is finished, this is the next statement that will be executed."
The "other function" never completes, and my code just sits there. It isn't hung, it's just waiting. I can pause/stop/play it. There seems to be some break-down in communication between the component's connection object, and the connection on the database.
The only way to successfully execute the read appears to be by removing the "ServicedComponent" derivation from the component's declaration for the connection to open and execute the read.
The weird bit is, when I run exactly the same code (as a ServicedComponent) against a SQL database on my PC (where the component is executing), it works fine, and reads the data.
Can someone please suggest why this is, and how I might get the ServicedComponent to successfully read from the SQL server on the DevServer?
Hope this makes sense.
Thanks for any responses/suggestions
Graeme
It's a little complicated, but I'll try and simplify.
On my PC (Windows 2000), I write a component which creates a SQLSERVER connection to a SQL Server database (SQL1 on DevServer).
I am stepping through the code to debug it.
When the component is doing an insert, the connection is created and opened successfully, and the data is inserted.
However...
When the component is doing a read (into a datareader), the connection is created (I can see it in SQL Enterprise Manager-Management-Process Info), BUT the status of the connection never goes to "open" in the IDE Watch Window.
When I pause execution, I see that the connection.Open() line is showing "This code has called into another function. When that function is finished, this is the next statement that will be executed."
The "other function" never completes, and my code just sits there. It isn't hung, it's just waiting. I can pause/stop/play it. There seems to be some break-down in communication between the component's connection object, and the connection on the database.
The only way to successfully execute the read appears to be by removing the "ServicedComponent" derivation from the component's declaration for the connection to open and execute the read.
The weird bit is, when I run exactly the same code (as a ServicedComponent) against a SQL database on my PC (where the component is executing), it works fine, and reads the data.
Can someone please suggest why this is, and how I might get the ServicedComponent to successfully read from the SQL server on the DevServer?
Hope this makes sense.
Thanks for any responses/suggestions
Graeme