Re: Does a Data Adapter Open() the connection automatically?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Ah, not really. The DataReader is the low-level data stream used by the Fill
method to fetch the rowset. It is RO/FO and can't be used to "scroll"
through the rowset returned by the query. The Fill populates one or more
DataTable instances within a DataSet--one for each rowset returned by the
query. All you can do with a DataReader in an ASP application is use it to
populate a bound control (like a grid or textbox) or access the individual
rows and columns one-by-one.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Chris Y" <chris@xxxxxxxxxxxxx> wrote in message
news:OeMZsphuFHA.2960@xxxxxxxxxxxxxxxxxxxxxxx
> Thanks all. I think I understand better now. Correct me if I do not get
> this correctly: a DataSet is useful if I have complicated operations to be
> conducted on a complicated query. If it is a simple read and just paging
> back and forth I am better off with a DataReader?
>
> Chris
>
> "William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
> news:Oy%23nz$guFHA.1264@xxxxxxxxxxxxxxxxxxxxxxx
>> Ah, it's mentioned in my book ;) and in Rob MacDonald's book on ASP
>> programming.
>> The DataSet is feature-rich--that's how it helps performance. It can
>> (does) also reduces the amount of code you have to write to support a
>> host of features that many applications need once the data is retrieved.
>> Yes, you have to persist it (yourself) in the Session state or elsewhere
>> as it's lost along with everything else not nailed down when the page
>> returns to the user.
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant
>> Microsoft MVP
>> www.betav.com/blog/billva
>> www.betav.com
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>>
>> "Chris Y" <chris@xxxxxxxxxxxxx> wrote in message
>> news:OQjC0AduFHA.3756@xxxxxxxxxxxxxxxxxxxxxxx
>>> Thanks Bill. Funny it is not mentioned at all in the docs.
>>>
>>> My next question is: how would a DataSet enhance performance? I am new
>>> to ASP.NET. I assume that it is still a stateless paradigm although I
>>> sense that the architecture is trying to make it pseudo stateful for
>>> developers. If a connection is closed everytime, wouldn't every piece of
>>> data have to be retrived all over again on the PostBack? Is there any
>>> available literature on this?
>>>
>>> Thanks.
>>>
>>> "William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
>>> news:OgboUTbuFHA.3188@xxxxxxxxxxxxxxxxxxxxxxx
>>>> The Fill opens and closes the connection (as long as it's closed
>>>> beforehand).
>>>>
>>>>
>>>> --
>>>> ____________________________________
>>>> William (Bill) Vaughn
>>>> Author, Mentor, Consultant
>>>> Microsoft MVP
>>>> www.betav.com/blog/billva
>>>> www.betav.com
>>>> Please reply only to the newsgroup so that others can benefit.
>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>> rights.
>>>> __________________________________
>>>>
>>>> "Chris Y" <chris@xxxxxxxxxxxxx> wrote in message
>>>> news:%23SV$XFbuFHA.1472@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> and Close() it too?
>>>>>
>>>>> Thanks
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Import / File Open dialog box for Access
    ... I am using the below code to open my dialog box and then it populates my ... I then am using a macro to export a query to that location. ... me to use a real e-mail address in public newsgroups. ... GlobalSign digital certificate is a forgery and should be deleted ...
    (microsoft.public.access.externaldata)
  • Re: Cant execute SQL and get recordset back.
    ... you want to and execute them together. ... William (Bill) Vaughn ... > row from the query. ... In cases where there are multiple resultsets, ...
    (microsoft.public.vb.database.ado)
  • Re: datetime conversion from UDT/GMT to localtime
    ... William (Bill) Vaughn ... My database has all date/times stored in UDT/GMT in datetime ... the query, the query then returns the correct resultset, but of course, the ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Complex RecordSource
    ... FROM Bill ... You need to join your menu table to the query to display their selections. ... her spouses ... as the last name on the name tag of the spouse. ...
    (microsoft.public.access.reports)
  • Re: Complex RecordSource
    ... FROM Bill ... You need to join your menu table to the query to display their selections. ... her spouses ... as the last name on the name tag of the spouse. ...
    (microsoft.public.access.reports)