Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Shared DB connections from PB.NET assemblies

$
0
0

I have developed a few PB.NET assemblies encapsulating datawindows which other users are incorporating as visual controls in their C# applications. Everything works well.

 

However, some of the PB.NET assemblies are being used a few times each in some C# windows. Each object has its own connection to the database. So when the C# window is opened, it creates numerous connections to the database.

 

Obviously, in theory I could create new PB.NET assemblies with 2, 3, 4 etc copies of the datawindows. However, I'd have to create custom controls for each application and I might have to move some of the client-side processing from C# to PB.NET, which isn't really practical.

 

Is there any way to share the database connection between the assemblies? Either by creating a connection in C# which can then be passed to each object, or maybe by connecting SQLCA within one assembly and getting a reference to pass to the others?

 

I'm sure technically this should be possible, but the hacks I've tried so far have all failed. Any assistance or pointers would be very useful.

 

Many thanks,

David


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>