Does the SQLDatasource control produce a disconnectected recordset?

J

John Kotuby

Hi all,
I am relatively new to ASP.NET 2.0 programming. I have some experience with
classic ASP and VB6. In Visual Web Developer (VS 2005) there a numerous ways
to work with data. In my application I am using a number of them, including
the SQLDataAdapter, DataTables, etc.

On one page I have chosen to use the SQLDatasource in conjunction with an
ASP Repeater control, because it was by far the quickest implementation for
my needs. However, I want to make sure I am getting a disconnected recordset
to work with. One that has closed the connection to the DB Server and will
not place any kinds of locks on the DB that might impede other users who
need exclusive locks to write to the table.

I have not found an answer for this question in the 4 books I have purchased
or in the VS 2005 documentation.

Thanks all in advance...
 
M

Mark Fitzpatrick

You can determine whether the item will be disconnected based upon which
type of resultset it returns. If it returns a dataset should be disconnected
because it is composed of datatables. A datatable is always loaded and then
it releases the connection. A DataReader is connected until it is closed and
pretty much always connected until you're done with it. The SQLDatasource
has a property called DataSourceMode that can be used to determine which it
will use, a DataSet or a DataReader. Go for the DataSet as that should give
you load it and release it data method.
 

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
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top