Object sharing

V

Vik

How to create an object (eg a dataadapter) once and use it in different Web
pages?

Thanks.
 
S

Scott Mitchell [MVP]

Vik said:
How to create an object (eg a dataadapter) once and use it in different Web
pages?

If you need to share objects among all users, use the Cache object. If
you need to share objects specific to a particular user, use the Session
object.

Now, might I ask why you want to share a DataAdapter among different
pages? Nine times out of ten, the ideal approach in a Web environment
is to create/open/use/close the database connections *on each page*, and
NOT to attempt to cache such objects.


--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
V

Vik

Sorry, my question was not clear.
I want to configure a dataadapter once and use it in the different pages in
design time, so I don't have to configure/reconfige the same dataadapter on
each page.

Vik
 
V

Vik

Thanks.

I already created a Component class and created a dataadapter there. Is this
what you mean?
But I don't know how to access this dataadapter from other classes (Web
pages). Is there an online tutorial about this?

Vik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top