Home All Groups Group Topic Archive Search About

.Net Windows Service ...data access problem

Author
1 May 2007 2:10 PM
Samuel Rhodes
Hi,
I am writing a .NET windows Service that will access the database every 10
minutes. When the service calls the function  in the business services layer
which in turn calls the correponding function in data access layer, this DAL
function fails. The reason 'apparently' being that the it can not read the
connection string information and hence can not create the database
connection.

Please note that that I am using enterprise library. All the projects
representing business service layer, DAL, Model, Web UI and also the the
windows service project are all in the same solution.

Can anyone tell me what should I do to get around this problem.

Thanks

-Sam

Author
1 May 2007 2:37 PM
Rad [Visual C# MVP]
On Tue, 1 May 2007 15:10:03 +0100, Samuel Rhodes wrote:

Show quoteHide quote
> Hi,
> I am writing a .NET windows Service that will access the database every 10
> minutes. When the service calls the function  in the business services layer
> which in turn calls the correponding function in data access layer, this DAL
> function fails. The reason 'apparently' being that the it can not read the
> connection string information and hence can not create the database
> connection.
>
> Please note that that I am using enterprise library. All the projects
> representing business service layer, DAL, Model, Web UI and also the the
> windows service project are all in the same solution.
>
> Can anyone tell me what should I do to get around this problem.
>
> Thanks
>
> -Sam

What error message do you get?
Are all your drivers up to date? click for free checkup

Author
4 May 2007 1:50 PM
Samuel Rhodes
Show quote Hide quote
"Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message
news:3rjv8egv6w4x$.dlg@thinkersroom.com...
> On Tue, 1 May 2007 15:10:03 +0100, Samuel Rhodes wrote:
>
>> Hi,
>> I am writing a .NET windows Service that will access the database every
>> 10
>> minutes. When the service calls the function  in the business services
>> layer
>> which in turn calls the correponding function in data access layer, this
>> DAL
>> function fails. The reason 'apparently' being that the it can not read
>> the
>> connection string information and hence can not create the database
>> connection.
>>
>> Please note that that I am using enterprise library. All the projects
>> representing business service layer, DAL, Model, Web UI and also the the
>> windows service project are all in the same solution.
>>
>> Can anyone tell me what should I do to get around this problem.
>>
>> Thanks
>>
>> -Sam
>
> What error message do you get?
> --
> Bits.Bytes
> http://bytes.thinkersroom.com


The error message is

"The requested database SharedDB is not defined in configuration."

where SharedDb respresents the db configuration store in the web.config
file. and by the way this web.config is offcourse in the Web UI project.

-Sami

Bookmark and Share