By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,749 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,749 IT Pros & Developers. It's quick & easy.

periodic check for records to print

P: n/a
Every 10 seconds I need to search a SQL table for orders to print. The orders
are created through WebForms on ASP.NET clients. The orders should not print
until
10 minutes before they are due.

The network printer will be available from the server running IIS and SQL
Server 2000.

If this were a Windows Forms application, then I would create a system timer
in Form1.Load(). How is this done in an ASP.NET application?
Feb 4 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Just a note of caution. Writing windows services can be tricky, so just be
prepared to possibly have to spend a little time with it. Debugging is a
little more complex and awkward.

--
Terry Burns
http://TrainingOn.net

"Phillip Williams" <WE******@newsgroups.nospam> wrote in message
news:B7**********************************@microsof t.com...
You should separate the printing function from the rest of your ASP.NET
forms
application. The purpose of a web application is to deliver data over
HTTP
protocol using an HTTP client (browser). The application you described is
most suitable for a service, i.e., create a windows service, that runs on
your web (or any other) server connected to the desired printer.

For detailed documentation on how to create a Windows Service:
http://msdn.microsoft.com/library/de...plications.asp
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony" wrote:
Every 10 seconds I need to search a SQL table for orders to print. The
orders
are created through WebForms on ASP.NET clients. The orders should not
print
until
10 minutes before they are due.

The network printer will be available from the server running IIS and SQL
Server 2000.

If this were a Windows Forms application, then I would create a system
timer
in Form1.Load(). How is this done in an ASP.NET application?

Feb 4 '06 #2

P: n/a
Thanks for the advice to separate the printing function. I am a little
familiar with the service programming model. The last service I wrote was for
NT 3.51 many many moons ago. I remember some limitations to accessing the GDI
and databases.

My printing function must connect and access data on SQL Server and then
print. I read through the information at the url that Phillip provided and
all of the other pages in that section. I stll have a couple questions
remaining:

Is there tech support that documents the .NET namespaces that can be used
inside a windows service?
Can I use the ADO.NET functions inside a windows service?
Can I print a crystal report from a windows service,
or can I use the GDI+ and System.Drawing.Printing.PrintDocument.Print()
method from a windows service?

"Terry Burns" wrote:
Just a note of caution. Writing windows services can be tricky, so just be
prepared to possibly have to spend a little time with it. Debugging is a
little more complex and awkward.

--
Terry Burns
http://TrainingOn.net

"Phillip Williams" <WE******@newsgroups.nospam> wrote in message
news:B7**********************************@microsof t.com...
You should separate the printing function from the rest of your ASP.NET
forms
application. The purpose of a web application is to deliver data over
HTTP
protocol using an HTTP client (browser). The application you described is
most suitable for a service, i.e., create a windows service, that runs on
your web (or any other) server connected to the desired printer.

For detailed documentation on how to create a Windows Service:
http://msdn.microsoft.com/library/de...plications.asp
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony" wrote:
Every 10 seconds I need to search a SQL table for orders to print. The
orders
are created through WebForms on ASP.NET clients. The orders should not
print
until
10 minutes before they are due.

The network printer will be available from the server running IIS and SQL
Server 2000.

If this were a Windows Forms application, then I would create a system
timer
in Form1.Load(). How is this done in an ASP.NET application?


Feb 4 '06 #3

P: n/a
Hi Tony,

As long as the PC that will run the server has the .net framework installed
then all of the functions that you listed will be available to the Windows
Service, as it would to any desktop application. The main difference between
the Windows Service and the desktop application is that in the former you
would not display a GUI that requires user input.

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony" wrote:
Thanks for the advice to separate the printing function. I am a little
familiar with the service programming model. The last service I wrote was for
NT 3.51 many many moons ago. I remember some limitations to accessing the GDI
and databases.

My printing function must connect and access data on SQL Server and then
print. I read through the information at the url that Phillip provided and
all of the other pages in that section. I stll have a couple questions
remaining:

Is there tech support that documents the .NET namespaces that can be used
inside a windows service?
Can I use the ADO.NET functions inside a windows service?
Can I print a crystal report from a windows service,
or can I use the GDI+ and System.Drawing.Printing.PrintDocument.Print()
method from a windows service?

"Terry Burns" wrote:
Just a note of caution. Writing windows services can be tricky, so just be
prepared to possibly have to spend a little time with it. Debugging is a
little more complex and awkward.

--
Terry Burns
http://TrainingOn.net

"Phillip Williams" <WE******@newsgroups.nospam> wrote in message
news:B7**********************************@microsof t.com...
You should separate the printing function from the rest of your ASP.NET
forms
application. The purpose of a web application is to deliver data over
HTTP
protocol using an HTTP client (browser). The application you described is
most suitable for a service, i.e., create a windows service, that runs on
your web (or any other) server connected to the desired printer.

For detailed documentation on how to create a Windows Service:
http://msdn.microsoft.com/library/de...plications.asp
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony" wrote:

> Every 10 seconds I need to search a SQL table for orders to print. The
> orders
> are created through WebForms on ASP.NET clients. The orders should not
> print
> until
> 10 minutes before they are due.
>
> The network printer will be available from the server running IIS and SQL
> Server 2000.
>
> If this were a Windows Forms application, then I would create a system
> timer
> in Form1.Load(). How is this done in an ASP.NET application?
>
>


Feb 5 '06 #4

P: n/a
sorry for couple week delay as I moved from design to implementation ...
Now I have created my windows service

The printdocument.print function is NOT firing the printPage event.

I am using several eventlog.WriteEntry() statements to know how my program
is working and which functions are called. The structure of the program is
similar to the example in the PrintDocument Class documentation.

There is no microsoft.public.dotnet.service group, so I am not sure if this
dotnet.framework.aspnet group is the proper place to continue this discussion.

I will post the question again at microsoft.public.dotnet.framework and
include my source code.

btw, the data entry web pages are working very nicely...

"Phillip Williams" wrote:
Hi Tony,

As long as the PC that will run the server has the .net framework installed
then all of the functions that you listed will be available to the Windows
Service, as it would to any desktop application. The main difference between
the Windows Service and the desktop application is that in the former you
would not display a GUI that requires user input.

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony" wrote:
Thanks for the advice to separate the printing function. I am a little
familiar with the service programming model. The last service I wrote was for
NT 3.51 many many moons ago. I remember some limitations to accessing the GDI
and databases.

My printing function must connect and access data on SQL Server and then
print. I read through the information at the url that Phillip provided and
all of the other pages in that section. I stll have a couple questions
remaining:

Is there tech support that documents the .NET namespaces that can be used
inside a windows service?
Can I use the ADO.NET functions inside a windows service?
Can I print a crystal report from a windows service,
or can I use the GDI+ and System.Drawing.Printing.PrintDocument.Print()
method from a windows service?

"Terry Burns" wrote:
Just a note of caution. Writing windows services can be tricky, so just be
prepared to possibly have to spend a little time with it. Debugging is a
little more complex and awkward.

--
Terry Burns
http://TrainingOn.net

"Phillip Williams" <WE******@newsgroups.nospam> wrote in message
news:B7**********************************@microsof t.com...
> You should separate the printing function from the rest of your ASP.NET
> forms
> application. The purpose of a web application is to deliver data over
> HTTP
> protocol using an HTTP client (browser). The application you described is
> most suitable for a service, i.e., create a windows service, that runs on
> your web (or any other) server connected to the desired printer.
>
> For detailed documentation on how to create a Windows Service:
> http://msdn.microsoft.com/library/de...plications.asp
>
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Tony" wrote:
>
>> Every 10 seconds I need to search a SQL table for orders to print. The
>> orders
>> are created through WebForms on ASP.NET clients. The orders should not
>> print
>> until
>> 10 minutes before they are due.
>>
>> The network printer will be available from the server running IIS and SQL
>> Server 2000.
>>
>> If this were a Windows Forms application, then I would create a system
>> timer
>> in Form1.Load(). How is this done in an ASP.NET application?
>>
>>

Feb 16 '06 #5

P: n/a
Found a caution from Microsoft not to do this.
"Classes within the System.Drawing.Printing namespace are not supported for
use within a Windows service or ASP.NET application or service. Attempting to
use these classes from within one of these application types may produce
unexpected problems, such as diminished service performance and run-time
exceptions.
"

found it at
http://windowssdk.msdn.microsoft.com...g_printing.asp

"Tony" wrote:
sorry for couple week delay as I moved from design to implementation ...
Now I have created my windows service

The printdocument.print function is NOT firing the printPage event.

I am using several eventlog.WriteEntry() statements to know how my program
is working and which functions are called. The structure of the program is
similar to the example in the PrintDocument Class documentation.

There is no microsoft.public.dotnet.service group, so I am not sure if this
dotnet.framework.aspnet group is the proper place to continue this discussion.

I will post the question again at microsoft.public.dotnet.framework and
include my source code.

btw, the data entry web pages are working very nicely...

"Phillip Williams" wrote:
Hi Tony,

As long as the PC that will run the server has the .net framework installed
then all of the functions that you listed will be available to the Windows
Service, as it would to any desktop application. The main difference between
the Windows Service and the desktop application is that in the former you
would not display a GUI that requires user input.

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony" wrote:
Thanks for the advice to separate the printing function. I am a little
familiar with the service programming model. The last service I wrote was for
NT 3.51 many many moons ago. I remember some limitations to accessing the GDI
and databases.

My printing function must connect and access data on SQL Server and then
print. I read through the information at the url that Phillip provided and
all of the other pages in that section. I stll have a couple questions
remaining:

Is there tech support that documents the .NET namespaces that can be used
inside a windows service?
Can I use the ADO.NET functions inside a windows service?
Can I print a crystal report from a windows service,
or can I use the GDI+ and System.Drawing.Printing.PrintDocument.Print()
method from a windows service?

"Terry Burns" wrote:

> Just a note of caution. Writing windows services can be tricky, so just be
> prepared to possibly have to spend a little time with it. Debugging is a
> little more complex and awkward.
>
> --
> Terry Burns
> http://TrainingOn.net
>
> "Phillip Williams" <WE******@newsgroups.nospam> wrote in message
> news:B7**********************************@microsof t.com...
> > You should separate the printing function from the rest of your ASP.NET
> > forms
> > application. The purpose of a web application is to deliver data over
> > HTTP
> > protocol using an HTTP client (browser). The application you described is
> > most suitable for a service, i.e., create a windows service, that runs on
> > your web (or any other) server connected to the desired printer.
> >
> > For detailed documentation on how to create a Windows Service:
> > http://msdn.microsoft.com/library/de...plications.asp
> >
> >
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Tony" wrote:
> >
> >> Every 10 seconds I need to search a SQL table for orders to print. The
> >> orders
> >> are created through WebForms on ASP.NET clients. The orders should not
> >> print
> >> until
> >> 10 minutes before they are due.
> >>
> >> The network printer will be available from the server running IIS and SQL
> >> Server 2000.
> >>
> >> If this were a Windows Forms application, then I would create a system
> >> timer
> >> in Form1.Load(). How is this done in an ASP.NET application?
> >>
> >>
>
>
>

Feb 18 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.