Showing posts with label table. Show all posts
Showing posts with label table. Show all posts

Thursday, March 29, 2012

Performance of CollectionBase class

Hi Guys,

I have a doubt which is little bit conceptual rather than a coding
convention.

I have a a table called products in which I have 40000 and odd products
which is expected to be frequently
accessed by the website. I'm having doubt in how fast i can serve this
product details to the requesting clients.

Basically, I have created necessary stored procedures to pull out the data
from the database. Now, I'm planning to have
a data access layer called product (a class) which contains properties,
enumerators etc., to load all the product details
by executing the stored procedure. That is, the data access layer will be
used by the business layer to deal with the product
details in the means of populating it in the webpage, filtering etc.,

So, the product class inherits Collectionbase class to have all the
enumerator, indexer funtionalities which is nothing
but a custom data source and which can be used with DataGrid etc., and all
the business logic like how to populate, what
to populate has been written in the business layer (it uses the data layer
to define the bl), which is eventually used by
the web developers to design the dynamic pages of the site.

I'm having doubt whether this kind of approach will work best in web
atmosphere rather than a windows application or not?
and also loading 40,000 records in a collection base object will give better
performance or not?

Please kindly suggest me, how to proceed in the terms of which is better way
to deal with this.

Thanks in Advance
Vadivel KumarI would put this way- if you are going to pull all 40K records in the
collection class and your web site will have multiple visitors (that means
multiple instances of the same class would be urnning in memory)- you are
definitely experience performance problem. If the business logic permits, I
would only pull the records necessary.

Also, .NET has memeory problem with larger objects (40K records is
definitely one of that kind). You are on the right track to analyse the
problem but you may have to compromise some performance to keep the business
logics flowing.

Prodip

"Vadivel Kumar" <donotreply@.spam-i-love-u.com> wrote in message
news:uBxbJK2EFHA.2700@.TK2MSFTNGP14.phx.gbl...
> Hi Guys,
> I have a doubt which is little bit conceptual rather than a coding
> convention.
> I have a a table called products in which I have 40000 and odd products
> which is expected to be frequently
> accessed by the website. I'm having doubt in how fast i can serve this
> product details to the requesting clients.
> Basically, I have created necessary stored procedures to pull out the data
> from the database. Now, I'm planning to have
> a data access layer called product (a class) which contains properties,
> enumerators etc., to load all the product details
> by executing the stored procedure. That is, the data access layer will be
> used by the business layer to deal with the product
> details in the means of populating it in the webpage, filtering etc.,
> So, the product class inherits Collectionbase class to have all the
> enumerator, indexer funtionalities which is nothing
> but a custom data source and which can be used with DataGrid etc., and all
> the business logic like how to populate, what
> to populate has been written in the business layer (it uses the data layer
> to define the bl), which is eventually used by
> the web developers to design the dynamic pages of the site.
> I'm having doubt whether this kind of approach will work best in web
> atmosphere rather than a windows application or not?
> and also loading 40,000 records in a collection base object will give
better
> performance or not?
> Please kindly suggest me, how to proceed in the terms of which is better
way
> to deal with this.
> Thanks in Advance
> Vadivel Kumar

On Tue, 15 Feb 2005 08:46:01 -0600, "Prodip Saha" <psaha@.bear.com>
wrote:

>Also, .NET has memeory problem with larger objects (40K records is
>definitely one of that kind). You are on the right track to analyse the
>problem but you may have to compromise some performance to keep the business
>logics flowing.

40k records would be a large collection of many small objects - which
can cause problems too.

--
Scott
http://www.OdeToCode.com/blogs/scott/
For example, my data layer contains a class called "product" which inherits
IEnumerator interface and this
class is used by business layer class "products" in which
i have written all my business logic etc.,

So, while retriving the any number of product i'm iterating
from product class in products class.

Is this makes sense and I'm following the standards? and If i follow the
standards i have to give up the price of performance. So, is this shows the
standards are not right?

I'm literrally confused. Advice me.

Thanks & Regards
Vadivel Kumar

"Vadivel Kumar" <donotreply@.spam-i-love-u.com> wrote in message
news:uBxbJK2EFHA.2700@.TK2MSFTNGP14.phx.gbl...
> Hi Guys,
> I have a doubt which is little bit conceptual rather than a coding
> convention.
> I have a a table called products in which I have 40000 and odd products
> which is expected to be frequently
> accessed by the website. I'm having doubt in how fast i can serve this
> product details to the requesting clients.
> Basically, I have created necessary stored procedures to pull out the data
> from the database. Now, I'm planning to have
> a data access layer called product (a class) which contains properties,
> enumerators etc., to load all the product details
> by executing the stored procedure. That is, the data access layer will be
> used by the business layer to deal with the product
> details in the means of populating it in the webpage, filtering etc.,
> So, the product class inherits Collectionbase class to have all the
> enumerator, indexer funtionalities which is nothing
> but a custom data source and which can be used with DataGrid etc., and all
> the business logic like how to populate, what
> to populate has been written in the business layer (it uses the data layer
> to define the bl), which is eventually used by
> the web developers to design the dynamic pages of the site.
> I'm having doubt whether this kind of approach will work best in web
> atmosphere rather than a windows application or not?
> and also loading 40,000 records in a collection base object will give
> better performance or not?
> Please kindly suggest me, how to proceed in the terms of which is better
> way to deal with this.
> Thanks in Advance
> Vadivel Kumar
And, I would like to know another one stuff like I'm developing a set of
libraries
which can be used with windows or web based interface my library code will
execute based on which kind
of interface it is deployed.

So, how to check this in C#, if you take C i normally use
preprocessor directive to check which platform, which architecture etc.,
based on that i will define my functions.

Kindly help me on this.

Thanks in Advance
Vadivel Kumar

"Vadivel Kumar" <donotreply@.spam-i-love-u.com> wrote in message
news:uBxbJK2EFHA.2700@.TK2MSFTNGP14.phx.gbl...
> Hi Guys,
> I have a doubt which is little bit conceptual rather than a coding
> convention.
> I have a a table called products in which I have 40000 and odd products
> which is expected to be frequently
> accessed by the website. I'm having doubt in how fast i can serve this
> product details to the requesting clients.
> Basically, I have created necessary stored procedures to pull out the data
> from the database. Now, I'm planning to have
> a data access layer called product (a class) which contains properties,
> enumerators etc., to load all the product details
> by executing the stored procedure. That is, the data access layer will be
> used by the business layer to deal with the product
> details in the means of populating it in the webpage, filtering etc.,
> So, the product class inherits Collectionbase class to have all the
> enumerator, indexer funtionalities which is nothing
> but a custom data source and which can be used with DataGrid etc., and all
> the business logic like how to populate, what
> to populate has been written in the business layer (it uses the data layer
> to define the bl), which is eventually used by
> the web developers to design the dynamic pages of the site.
> I'm having doubt whether this kind of approach will work best in web
> atmosphere rather than a windows application or not?
> and also loading 40,000 records in a collection base object will give
> better performance or not?
> Please kindly suggest me, how to proceed in the terms of which is better
> way to deal with this.
> Thanks in Advance
> Vadivel Kumar

Performance of CollectionBase class

Hi Guys,
I have a doubt which is little bit conceptual rather than a coding
convention.
I have a a table called products in which I have 40000 and odd products
which is expected to be frequently
accessed by the website. I'm having doubt in how fast i can serve this
product details to the requesting clients.
Basically, I have created necessary stored procedures to pull out the data
from the database. Now, I'm planning to have
a data access layer called product (a class) which contains properties,
enumerators etc., to load all the product details
by executing the stored procedure. That is, the data access layer will be
used by the business layer to deal with the product
details in the means of populating it in the webpage, filtering etc.,
So, the product class inherits Collectionbase class to have all the
enumerator, indexer funtionalities which is nothing
but a custom data source and which can be used with DataGrid etc., and all
the business logic like how to populate, what
to populate has been written in the business layer (it uses the data layer
to define the bl), which is eventually used by
the web developers to design the dynamic pages of the site.
I'm having doubt whether this kind of approach will work best in web
atmosphere rather than a windows application or not?
and also loading 40,000 records in a collection base object will give better
performance or not?
Please kindly suggest me, how to proceed in the terms of which is better way
to deal with this.
Thanks in Advance
Vadivel KumarI would put this way- if you are going to pull all 40K records in the
collection class and your web site will have multiple visitors (that means
multiple instances of the same class would be urnning in memory)- you are
definitely experience performance problem. If the business logic permits, I
would only pull the records necessary.
Also, .NET has memeory problem with larger objects (40K records is
definitely one of that kind). You are on the right track to analyse the
problem but you may have to compromise some performance to keep the business
logics flowing.
Prodip
"Vadivel Kumar" <donotreply@.spam-i-love-u.com> wrote in message
news:uBxbJK2EFHA.2700@.TK2MSFTNGP14.phx.gbl...
> Hi Guys,
> I have a doubt which is little bit conceptual rather than a coding
> convention.
> I have a a table called products in which I have 40000 and odd products
> which is expected to be frequently
> accessed by the website. I'm having doubt in how fast i can serve this
> product details to the requesting clients.
> Basically, I have created necessary stored procedures to pull out the data
> from the database. Now, I'm planning to have
> a data access layer called product (a class) which contains properties,
> enumerators etc., to load all the product details
> by executing the stored procedure. That is, the data access layer will be
> used by the business layer to deal with the product
> details in the means of populating it in the webpage, filtering etc.,
> So, the product class inherits Collectionbase class to have all the
> enumerator, indexer funtionalities which is nothing
> but a custom data source and which can be used with DataGrid etc., and all
> the business logic like how to populate, what
> to populate has been written in the business layer (it uses the data layer
> to define the bl), which is eventually used by
> the web developers to design the dynamic pages of the site.
> I'm having doubt whether this kind of approach will work best in web
> atmosphere rather than a windows application or not?
> and also loading 40,000 records in a collection base object will give
better
> performance or not?
> Please kindly suggest me, how to proceed in the terms of which is better
way
> to deal with this.
> Thanks in Advance
> Vadivel Kumar
>

On Tue, 15 Feb 2005 08:46:01 -0600, "Prodip Saha" <psaha@.bear.com>
wrote:

>Also, .NET has memeory problem with larger objects (40K records is
>definitely one of that kind). You are on the right track to analyse the
>problem but you may have to compromise some performance to keep the busines
s
>logics flowing.
>
40k records would be a large collection of many small objects - which
can cause problems too.
Scott
http://www.OdeToCode.com/blogs/scott/
For example, my data layer contains a class called "product" which inherits
IEnumerator interface and this
class is used by business layer class "products" in which
i have written all my business logic etc.,
So, while retriving the any number of product i'm iterating
from product class in products class.
Is this makes sense and I'm following the standards? and If i follow the
standards i have to give up the price of performance. So, is this shows the
standards are not right?
I'm literrally . Advice me.
Thanks & Regards
Vadivel Kumar
"Vadivel Kumar" <donotreply@.spam-i-love-u.com> wrote in message
news:uBxbJK2EFHA.2700@.TK2MSFTNGP14.phx.gbl...
> Hi Guys,
> I have a doubt which is little bit conceptual rather than a coding
> convention.
> I have a a table called products in which I have 40000 and odd products
> which is expected to be frequently
> accessed by the website. I'm having doubt in how fast i can serve this
> product details to the requesting clients.
> Basically, I have created necessary stored procedures to pull out the data
> from the database. Now, I'm planning to have
> a data access layer called product (a class) which contains properties,
> enumerators etc., to load all the product details
> by executing the stored procedure. That is, the data access layer will be
> used by the business layer to deal with the product
> details in the means of populating it in the webpage, filtering etc.,
> So, the product class inherits Collectionbase class to have all the
> enumerator, indexer funtionalities which is nothing
> but a custom data source and which can be used with DataGrid etc., and all
> the business logic like how to populate, what
> to populate has been written in the business layer (it uses the data layer
> to define the bl), which is eventually used by
> the web developers to design the dynamic pages of the site.
> I'm having doubt whether this kind of approach will work best in web
> atmosphere rather than a windows application or not?
> and also loading 40,000 records in a collection base object will give
> better performance or not?
> Please kindly suggest me, how to proceed in the terms of which is better
> way to deal with this.
> Thanks in Advance
> Vadivel Kumar
>
And, I would like to know another one stuff like I'm developing a set of
libraries
which can be used with windows or web based interface my library code will
execute based on which kind
of interface it is deployed.
So, how to check this in C#, if you take C i normally use
preprocessor directive to check which platform, which architecture etc.,
based on that i will define my functions.
Kindly help me on this.
Thanks in Advance
Vadivel Kumar
"Vadivel Kumar" <donotreply@.spam-i-love-u.com> wrote in message
news:uBxbJK2EFHA.2700@.TK2MSFTNGP14.phx.gbl...
> Hi Guys,
> I have a doubt which is little bit conceptual rather than a coding
> convention.
> I have a a table called products in which I have 40000 and odd products
> which is expected to be frequently
> accessed by the website. I'm having doubt in how fast i can serve this
> product details to the requesting clients.
> Basically, I have created necessary stored procedures to pull out the data
> from the database. Now, I'm planning to have
> a data access layer called product (a class) which contains properties,
> enumerators etc., to load all the product details
> by executing the stored procedure. That is, the data access layer will be
> used by the business layer to deal with the product
> details in the means of populating it in the webpage, filtering etc.,
> So, the product class inherits Collectionbase class to have all the
> enumerator, indexer funtionalities which is nothing
> but a custom data source and which can be used with DataGrid etc., and all
> the business logic like how to populate, what
> to populate has been written in the business layer (it uses the data layer
> to define the bl), which is eventually used by
> the web developers to design the dynamic pages of the site.
> I'm having doubt whether this kind of approach will work best in web
> atmosphere rather than a windows application or not?
> and also loading 40,000 records in a collection base object will give
> better performance or not?
> Please kindly suggest me, how to proceed in the terms of which is better
> way to deal with this.
> Thanks in Advance
> Vadivel Kumar
>

Performance question regarding dynamic controls

I am trying to build a reasonably large table (maybe 50 rows x 12
columns) dynamically on the server-side using the Table(), TableRow(),
and TableCell() objects provided by ASP.NET. For various reasons I
don't want to use a datagrid and do any binding, but would rather build
the table dynamically.
My question has to do with the performance of these objects - would it
be significantly faster for me to just dynamically generate some static
HTML strings and write those out to the client instead of instantiating
all these objects? I have a feeling that it would be faster, but no
idea how much so. I realize that using static HTML will preclude using
any ASP.NET server side objects in the code, but this purpose it may be
ok.
Does anyone know how much slower the dynamic controls would be as
compared to standard string output?
Thanks!I doubt you would see any performance difference between the two. If
it were me, I'd build whatever was most readable and maintainable. I'd
only worry about performance if it proved noticably slow during
testing.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

Performance question regarding dynamic controls

I am trying to build a reasonably large table (maybe 50 rows x 12
columns) dynamically on the server-side using the Table(), TableRow(),
and TableCell() objects provided by ASP.NET. For various reasons I
don't want to use a datagrid and do any binding, but would rather build
the table dynamically.

My question has to do with the performance of these objects - would it
be significantly faster for me to just dynamically generate some static
HTML strings and write those out to the client instead of instantiating
all these objects? I have a feeling that it would be faster, but no
idea how much so. I realize that using static HTML will preclude using
any ASP.NET server side objects in the code, but this purpose it may be
ok.

Does anyone know how much slower the dynamic controls would be as
compared to standard string output?

Thanks!I doubt you would see any performance difference between the two. If
it were me, I'd build whatever was most readable and maintainable. I'd
only worry about performance if it proved noticably slow during
testing.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

Monday, March 26, 2012

periodic check for records to print

Every 10 seconds I need to search a SQL table for orders to print. The order
s
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?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" <WEBSWAPP@.newsgroups.nospam> wrote in message
news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.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/d...r />
ations.asp
>
> --
> 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 fo
r
NT 3.51 many many moons ago. I remember some limitations to accessing the GD
I
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" <WEBSWAPP@.newsgroups.nospam> wrote in message
> news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.com...
>
>
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 betwee
n
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:
>
sorry for couple w 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 discussio
n.
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 installe
d
> 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 betw
een
> 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:
>
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 t
o
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.co...ng_printing.asp
"Tony" wrote:
> sorry for couple w 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 thi
s
> dotnet.framework.aspnet group is the proper place to continue this discuss
ion.
> 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:
>

periodic check for records to print

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?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" <WEBSWAPP@.newsgroups.nospam> wrote in message
news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.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/d...lications .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?
>>
>
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" <WEBSWAPP@.newsgroups.nospam> wrote in message
> news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.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/d...lications .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?
> >>
> >>
>
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" <WEBSWAPP@.newsgroups.nospam> wrote in message
> > news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.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/d...lications .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?
> > >>
> > >>
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" <WEBSWAPP@.newsgroups.nospam> wrote in message
> > > news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.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/d...lications .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?
> > > >>
> > > >>
> > >
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.co...ng_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" <WEBSWAPP@.newsgroups.nospam> wrote in message
> > > > news:B765641F-9B69-47A5-B8AB-1C1A1662EE46@.microsoft.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/d...lications .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?
> > > > >>
> > > > >>
> > > > > >

Wednesday, March 21, 2012

Perplexity on relation over a select count

I need to get the child of parent/child relation and I've some perplexity
about the best method to use.
The classic (select count(*) id from table where id = a.parentid) nested
into a select generate a lot of
roundrip if used for a large set of results, but for small search is quite
good.
But what about the new ado.net relation table? Is more efficient? What does
it do internally?
Take on mind that I'm working over a 2003 access database, so the choice
cannot use SP as well as complex results set that return table object that
SQL server can return.
Thank you
Andreaperhaps you should post your question to one of the 'ms access' forums. You
may have better luck.
-- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"andrea" <googlegroups@.freemail.it> wrote in message
news:9fa0d7351833f8c812a7cff697bc@.news.microsoft.com...
>I need to get the child of parent/child relation and I've some perplexity
>about the best method to use.
> The classic (select count(*) id from table where id = a.parentid) nested
> into a select generate a lot of
> roundrip if used for a large set of results, but for small search is quite
> good.
> But what about the new ado.net relation table? Is more efficient? What
> does it do internally?
> Take on mind that I'm working over a 2003 access database, so the choice
> cannot use SP as well as complex results set that return table object that
> SQL server can return.
> Thank you
> Andrea
>
>

Perplexity on relation over a select count

I need to get the child of parent/child relation and I've some perplexity
about the best method to use.

The classic (select count(*) id from table where id = a.parentid) nested
into a select generate a lot of
roundrip if used for a large set of results, but for small search is quite
good.

But what about the new ado.net relation table? Is more efficient? What does
it do internally?

Take on mind that I'm working over a 2003 access database, so the choice
cannot use SP as well as complex results set that return table object that
SQL server can return.

Thank you
Andreaperhaps you should post your question to one of the 'ms access' forums. You
may have better luck.

--
-- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"andrea" <googlegroups@.freemail.it> wrote in message
news:9fa0d7351833f8c812a7cff697bc@.news.microsoft.c om...
>I need to get the child of parent/child relation and I've some perplexity
>about the best method to use.
> The classic (select count(*) id from table where id = a.parentid) nested
> into a select generate a lot of
> roundrip if used for a large set of results, but for small search is quite
> good.
> But what about the new ado.net relation table? Is more efficient? What
> does it do internally?
> Take on mind that I'm working over a 2003 access database, so the choice
> cannot use SP as well as complex results set that return table object that
> SQL server can return.
> Thank you
> Andrea

Friday, March 16, 2012

Persist tables controls

Hi everyone,

I don't know why all the controls of the Table class (server control)
has to be reconstructed for each page load. The MSDN said that it is
because the children controls are not the Table properties. But why
other controls like ListBox or DataGrid can persist their child
controls?

I'm very confused about this.

Thanks for any reply,

Nhat YenHi,

all non-controls are persisted via ViewState and they can be restored that
way. But controls do need to recreated on every request (and they then load
their own state indepedently after they have been created)

ListBox works so that it saves the state by calling SaveViewState of its
Items collection (ListItemCollection) which stores the items in key/value
sense. On postback items are loaded from ViewState and ListItemCollection
is reconstructed. E.g ListBox actually uses the similar procedure to
repopulate the collection. ListItems aren't controls so therefore ListBox
can work this way without controls "in the middle".

DataGrid can recreate the controls because they (child controls) are usually
specified in templates (or via columns). DataGrid stores the count of rows
which it uses to recreate the Items collection (by instantiating templates)
and then the child controls load their state independently after they've
been created. So basically DataGrid doesn't store the child controls but
recreates them on postback.

Basically you can't avoid recreating controls because control are themselves
responsible for storing their state. Also it would be terribly inefficient
tho store complete control instances to ViewState, therefore only control
state is stored and controls themselves are recreated.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Nhat Yen" <s2119205@.rmit.edu.vn> wrote in message
news:1d84a655.0402211915.5cfed176@.posting.google.c om...
> Hi everyone,
> I don't know why all the controls of the Table class (server control)
> has to be reconstructed for each page load. The MSDN said that it is
> because the children controls are not the Table properties. But why
> other controls like ListBox or DataGrid can persist their child
> controls?
> I'm very confused about this.
> Thanks for any reply,
> Nhat Yen
Thanks for very clear explanation Teemu, it help me a lot.

Again thank you!

"Teemu Keiski" <joteke@.aspalliance.com> wrote in message news:<erMHQre#DHA.3816@.tk2msftngp13.phx.gbl>...
> Hi,
> all non-controls are persisted via ViewState and they can be restored that
> way. But controls do need to recreated on every request (and they then load
> their own state indepedently after they have been created)
> ListBox works so that it saves the state by calling SaveViewState of its
> Items collection (ListItemCollection) which stores the items in key/value
> sense. On postback items are loaded from ViewState and ListItemCollection
> is reconstructed. E.g ListBox actually uses the similar procedure to
> repopulate the collection. ListItems aren't controls so therefore ListBox
> can work this way without controls "in the middle".
> DataGrid can recreate the controls because they (child controls) are usually
> specified in templates (or via columns). DataGrid stores the count of rows
> which it uses to recreate the Items collection (by instantiating templates)
> and then the child controls load their state independently after they've
> been created. So basically DataGrid doesn't store the child controls but
> recreates them on postback.
> Basically you can't avoid recreating controls because control are themselves
> responsible for storing their state. Also it would be terribly inefficient
> tho store complete control instances to ViewState, therefore only control
> state is stored and controls themselves are recreated.
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
> "Nhat Yen" <s2119205@.rmit.edu.vn> wrote in message
> news:1d84a655.0402211915.5cfed176@.posting.google.c om...
> > Hi everyone,
> > I don't know why all the controls of the Table class (server control)
> > has to be reconstructed for each page load. The MSDN said that it is
> > because the children controls are not the Table properties. But why
> > other controls like ListBox or DataGrid can persist their child
> > controls?
> > I'm very confused about this.
> > Thanks for any reply,
> > Nhat Yen
Thanks for very clear explanation Teemu, it help me a lot.

Again thank you!

"Teemu Keiski" <joteke@.aspalliance.com> wrote in message news:<erMHQre#DHA.3816@.tk2msftngp13.phx.gbl>...
> Hi,
> all non-controls are persisted via ViewState and they can be restored that
> way. But controls do need to recreated on every request (and they then load
> their own state indepedently after they have been created)
> ListBox works so that it saves the state by calling SaveViewState of its
> Items collection (ListItemCollection) which stores the items in key/value
> sense. On postback items are loaded from ViewState and ListItemCollection
> is reconstructed. E.g ListBox actually uses the similar procedure to
> repopulate the collection. ListItems aren't controls so therefore ListBox
> can work this way without controls "in the middle".
> DataGrid can recreate the controls because they (child controls) are usually
> specified in templates (or via columns). DataGrid stores the count of rows
> which it uses to recreate the Items collection (by instantiating templates)
> and then the child controls load their state independently after they've
> been created. So basically DataGrid doesn't store the child controls but
> recreates them on postback.
> Basically you can't avoid recreating controls because control are themselves
> responsible for storing their state. Also it would be terribly inefficient
> tho store complete control instances to ViewState, therefore only control
> state is stored and controls themselves are recreated.
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
> "Nhat Yen" <s2119205@.rmit.edu.vn> wrote in message
> news:1d84a655.0402211915.5cfed176@.posting.google.c om...
> > Hi everyone,
> > I don't know why all the controls of the Table class (server control)
> > has to be reconstructed for each page load. The MSDN said that it is
> > because the children controls are not the Table properties. But why
> > other controls like ListBox or DataGrid can persist their child
> > controls?
> > I'm very confused about this.
> > Thanks for any reply,
> > Nhat Yen