Re: ASP.NET binding to DataReader
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Mon, 27 Aug 2007 03:47:49 GMT
Hi Mark,
I think maybe Andrew also want to utilize the declarative/codeless
databinding model of ASP.NET 2.0 to populate the controls with records
retrieved through datareader.
Hi Anderw,
I also think that using an objectDataSource here is not quite confortable
and convenient. Because if you use DataReader, your business object query
the DB and return datareader, the close/disposing code should also be
performed by the buisness object. However, during the databinding period,
the objectdatasource will use the datareader to perform databinding against
the target databound control. Thus, your business class has to determine
when to close/dispose the datareader(this is the question here...). Or you
can let the ObjectDatasource to close the DataReader(expose from your
business object through some public interface/methods).
So far, I think you can consider use the following event of
objectdatasource control:
#ObjectDataSource.ObjectDisposing Event
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdat
asource.objectdisposing.aspx
it can let you do some work before the ObjectDataSource disposing the
underlying business class object. You can get the assocated DataReader from
the object instance and close it at that time. How do you think?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx><OjMl28m5HHA.980@xxxxxxxxxxxxxxxxxxxx>
References: <Ot62W0m5HHA.5980@xxxxxxxxxxxxxxxxxxxx>
<eH8Eu#m5HHA.5844@xxxxxxxxxxxxxxxxxxxx>
In-Reply-To: <eH8Eu#m5HHA.5844@xxxxxxxxxxxxxxxxxxxx>82.45.166.9
Subject: Re: ASP.NET binding to DataReader
Date: Fri, 24 Aug 2007 21:23:16 +0100
Lines: 14
Organization: http://www.markrae.net
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6000.16480
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480
Message-ID: <#O38ryo5HHA.1164@xxxxxxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 82-45-166-9.cable.ubr06.hari.blueyonder.co.uk
Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gblserver
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:39736
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
"Andrew Robinson" <nemoby@xxxxxxxxxxxxx> wrote in message
news:eH8Eu%23m5HHA.5844@xxxxxxxxxxxxxxxxxxxxxxx
isn't that the purpose of an ODS? to link your data access layer to
data controls?
If you have a DAL, the data controls are completely unnecessary...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
.
- Follow-Ups:
- Re: ASP.NET binding to DataReader
- From: Mark Rae [MVP]
- Re: ASP.NET binding to DataReader
- References:
- ASP.NET binding to DataReader
- From: Andrew Robinson
- Re: ASP.NET binding to DataReader
- From: Mark Rae [MVP]
- Re: ASP.NET binding to DataReader
- From: Andrew Robinson
- Re: ASP.NET binding to DataReader
- From: Mark Rae [MVP]
- ASP.NET binding to DataReader
- Prev by Date: RE: How to show the UpdateProgress contents at the center of monitor by using only CSS
- Next by Date: Re: Any tricks to protect data in GridView from being copied?
- Previous by thread: Re: ASP.NET binding to DataReader
- Next by thread: Re: ASP.NET binding to DataReader
- Index(es):
Relevant Pages
|