Hi all
I've just recently moved to .NET from VB6 and have a small question.
In VB6 I was able to create a global database connection object by defining it in a VB module. Example :
Public conn As ADODB.Connection
sub main()
Set conn = New ADODB.Connection
...
end sub
What I've done in .NET is create a connection class that takes a connection string and returns a connection object ( the idea is that I can use this class with any project to create a connection object). This works fine - what I need to know is how can I create a global object from this class - will I need to create a module and define it there or is there a better way? All examples I have seen involve creating a connection, adapter, dataset on each form.
Any help would be appreciated.
OM
I've just recently moved to .NET from VB6 and have a small question.
In VB6 I was able to create a global database connection object by defining it in a VB module. Example :
Public conn As ADODB.Connection
sub main()
Set conn = New ADODB.Connection
...
end sub
What I've done in .NET is create a connection class that takes a connection string and returns a connection object ( the idea is that I can use this class with any project to create a connection object). This works fine - what I need to know is how can I create a global object from this class - will I need to create a module and define it there or is there a better way? All examples I have seen involve creating a connection, adapter, dataset on each form.
Any help would be appreciated.
OM