473,586 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server.CreateOb ject Vs CreateObject

I am working on a project where Server.CreateOb ject is replaced with
CreateObject all over the project. Though I know that this will
improve performance in terms of Memory overlhead because of how the
object creation happens with Server.CreateOb ject, I would like to
create 'visible scenarios' that i create with code to show people that
'"look. here's the difference". Is it possible ?

I will create a page with 2 calls, 1 with Server.CreateOb ject and 1
with CreateObject, run the code and see the difference. Any thoughts ?
Thanks.
Anand.

Jan 15 '08 #1
3 7032

"Sagar" <an********@gma il.comwrote in message
news:d6******** *************** ***********@1g2 000hsl.googlegr oups.com...
I am working on a project where Server.CreateOb ject is replaced with
CreateObject all over the project. Though I know that this will
improve performance in terms of Memory overlhead because of how the
object creation happens with Server.CreateOb ject, I would like to
create 'visible scenarios' that i create with code to show people that
'"look. here's the difference". Is it possible ?

I will create a page with 2 calls, 1 with Server.CreateOb ject and 1
with CreateObject, run the code and see the difference. Any thoughts ?
I've never heard of any significant memory usage difference between the two
and I find it difficult to see what might be the cause of such a difference.

The only real difference between the two is handling of OnStartPage and
OnEndPage methods on the classes default interface.

When using Server.CreateOb ject after the object is instanced ASP looks for
the OnStartPage method on the returned interface, if found it is called with
the current script context as a parameter.

This handling does not occur for CreateObject. However, since IIS 5.0 ASP
runs as a COM+ context and components can implement IObjectContext through
which the scripting context can be discovered. This approach works whether
the Server version is used or not.

Personally I still implement OnStartPage since its a lot less faff but it
does require the use of Server.CreateOb ject.

--
Anthony Jones - MVP ASP/ASP.NET
Jan 15 '08 #2
Not really. I have read in other sites that there IS a difference.

With Server.CreateOb ject, the object instance is created with the
context of transaction
With CreateObject, the obect is created without any context.

Let me know if this is incorrect.

and Is there a way to demo these scenarions and some simple code ?

Thanks,
Anand.

On Jan 15, 6:35*pm, "Anthony Jones" <A...@yadayaday ada.comwrote:
"Sagar" <anandsa...@gma il.comwrote in message

news:d6******** *************** ***********@1g2 000hsl.googlegr oups.com...
I am working on a project where Server.CreateOb ject is replaced with
CreateObject all over the project. Though I know that this will
improve performance in terms of Memory overlhead because of how the
object creation happens with Server.CreateOb ject, I would like to
create 'visible scenarios' that i create with code to show people that
'"look. here's the difference". Is it possible ?
I will create a page with 2 calls, 1 with Server.CreateOb ject and 1
with CreateObject, run the code and see the difference. Any thoughts ?

I've never heard of any significant memory usage difference between the two
and I find it difficult to see what might be the cause of such a difference.

The only real difference between the two is handling of OnStartPage and
OnEndPage methods on the classes default interface.

When using Server.CreateOb ject after the object is instanced ASP looks for
the OnStartPage method on the returned interface, if found it is called with
the current script context as a parameter.

This handling does not occur for CreateObject. *However, since IIS 5.0 ASP
runs as a COM+ context and components can implement IObjectContext through
which the scripting context can be discovered. *This approach works whether
the Server version is used or not.

Personally I still implement OnStartPage since its a lot less faff but it
does require the use of Server.CreateOb ject.

--
Anthony Jones - MVP ASP/ASP.NET
Jan 15 '08 #3
You may need to ask the IIS folks as they may know of recent issues regarding this matter.

An example of an iis issue :

http://support.microsoft.com/default.aspx/kb/193230

Jan 16 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2905
by: Erik | last post by:
I'm using ASP 3.0 and SQL Server 2000. I keep getting this error: a.. Error Type: ADODB.Recordset (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /databaseconect.asp, line 22 It seems to have to do with the lock or cursor type in SQL Server. Here is my code. Please help
14
1843
by: CJM | last post by:
I have a query which produces different results in the Access query builder and in an ASP page (via ADO) An example of the query is: ---------------------------------------------------------- Select 'Ranked' as Source, H.HotelName, H.TelNo, H.URL, H.Location, H.HotelID, Rank from (Hotels H Inner Join PrefHotels P on H.HotelID = P.HotelID)...
14
11105
by: wk6pack | last post by:
Hi, I'm getting this error on my asp page intermittently. One day it is fine, another day, it crashes a lot. I have searched the web and microsoft on this and they say it is a recordset assigned to a session variable. I dont assign any record sets to session variables in my code. I assign values to the session variables though. The...
4
1521
by: Jack | last post by:
Hello, I have an application on my desktop where I have hardcoded the connection string. Now I need to move the application to our test webserver. Here I need to use the server.mappath method to connect to the database. The database is in the same directory as the new application named gwis. Hence the database is in the gwis directory in the...
12
2054
by: karen | last post by:
Hi all : this is going to be a long post. So i apologize in advance :) i am converting a java program in VB right now. I am a java programmer by trade. so i am no expert in this department. I have written the following three class: 1.icoCORE_test 2.icoMINDB_test
28
4827
by: Gil | last post by:
can i have a client pc trigger access.exe to open on the server side pc? i want to have the server run special functions and return the output to the clients without having the clients run the functions itself.
0
3997
by: david_cheong2002 | last post by:
i have the problem where i try to call the create the server object in my asp page. I already register the dll using .net framework v2 (regasm) and i add this code in my asp. set a = server.createobject("Mobile88Hash.sHa1HaSh") response.write a.GetAuthor & "<br>" response.write a.ComputeHash("appleM0001236A000000014500MYR1") but i get...
7
6199
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function Body_Onload() ' create the object Set obj = Server.CreateObject("UploadImage.cTest") ' use method of the object Body_Onload = obj.cTestDelete
17
2645
by: Anil Gupte | last post by:
I am using the following to try to connect to the database, but it does not seem to be working. Dim sConnString sConnString = "Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MediaDB;Data Source=MEDIAMACHINE\SQLEXPRESS" Connection.Open sConnString Dim Recordset Set...
0
8202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.