microsoft application blocks

L

Lucas Tam

Just Curious, how many of you are using microsoft application blocks for
your application?

I'm using the data application block - it makes database calls a lot
simplier.
 
G

Guoqi Zheng

Yes, I am trying to use it as well. but I am afraid of bugs.

I saw they use function to return a datareader. As far as I understand, if
you disconnect connection object, data reader will disappear as well, if you
don' t close connection, then you have a connection leak there, so data
reader can not be returned by a function.

Do you find any bugs there?

--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com
 
G

Greg Burns

You can return a datareader via a function if the reader was opened as such:

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

The connection will close once the reader is closed.

Greg


Guoqi Zheng said:
Yes, I am trying to use it as well. but I am afraid of bugs.

I saw they use function to return a datareader. As far as I understand, if
you disconnect connection object, data reader will disappear as well, if you
don' t close connection, then you have a connection leak there, so data
reader can not be returned by a function.

Do you find any bugs there?

--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com
 
L

Lucas Tam

I saw they use function to return a datareader. As far as I
understand, if you disconnect connection object, data reader will
disappear as well, if you don' t close connection, then you have a
connection leak there, so data reader can not be returned by a
function.

No, it works fine.

This is how you use the datareader portion:


Dim dr as sqlclient.sqldatareader = sqlhelper.executereader(...)


When you're done with the reader, go: dr.close.
 

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

Top