Skip to main content

Problem:

Can you share a Database Connection between .Net Languages (VB and C#) and COBOL. In the scenario C# would create a connection and pass that to COBOL. COBOL would then use the connection and issue its Embedded SQL on the same connection.

Is this possible ?

Resolution:

Yes using ADO.Net you can pass a connection object from C# to the COBOL. The COBOL then can use EXEC ADO BIND to  specify that the C# connection is to be used when executing embedded SQL.

Attached to this article is some example code showing how to do this.

Attachments:

DNSharedConnection.zip

Old KB# 1505