Perhaps I'm expecting this to be altogether more visual in nature than it
is.
I thought that if I created form A and form B then put a bunch of code in
module C.cs that somehow I could get A and B to call the functions in C.cs
in such a manner that the code in C.cs could affect the properties of A and
B.
If I understand you correctly, I should start with frmSuperClass then
descend frmA and frmB from it so that I could put any code that I wanted to
affect frmA and frmB in frmSuperClass.
Regarding the connection. I open it when needed and close it when I'm
finished. It's just that I didn't want to use any additional resouces for
another connection object and I didn't want to add another layer of
complexity to the app. If I follow your reasoning, you would build a
function that would return a connection when called. Where would you put
such a function? Would this require that all forms that need to access data
be descended from a common form with the connection factory function within
it? What about the connection used by Crystal Reports?
Thanks.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uF******** ******@TK2MSFTN GP10.phx.gbl...
Christopher,
I would create a base form that instantiates this stuff for you, and
then derive from that form for all of your forms.
Also, you should not create one database connection (which might mean
you keep it open most of the time). If anything, have a factory method
that creates connections for you, which you then open and close as soon as
you are done.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Christophe r Weaver" <we*****@nospam verizon.net> wrote in message
news:O3******** ******@TK2MSFTN GP10.phx.gbl... This is a broad question. I am developing a multiform Windows
applications. There is only one database involved. I would like to
establish one connection object and a few DataAdapters and DataSets that
I can use in several of the windows. How and where do I instantiate
these objects so I can utilize them from any of the forms in the
application?
Thanks.