Question Passing Connection Information

andyh20

Member
Joined
Aug 4, 2009
Messages
11
Programming Experience
5-10
Hi,

I'm coming from a VB6 background with a few years' layoff from programming. Now trying to get my head around .NET.

I'm writing a logical 3 tier forms app with all components(pres, bl, dal) residing on my client machine. I'm connecting to SQL server.

I'm struggling to understand how to get a connectionstring to my DAL and keep it there. I have no object references I persist to the DAL (perhaps that's my problem) so can't store it in there. My alternative seems to be to pass the connection string from the client through the BL, to the DL at every database call which seems a little clunky. In the past I would have persisted the connection object but with connection pooling this seems the wrong thing to do.

Can anyone suggest a sensible architecture for accomplishing what I'm trying to do?

Thanks,
Andy
 
I tend to use the built in generator facilities for building a DAL. You get a well encapsulated set of classes that are split into data containers and devices that push/pull data. They get their connection info from a central location.
 

Latest posts

Back
Top