microsoft application blocks

  • Thread starter Thread starter Guoqi Zheng
  • Start date Start date
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.
 
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
 
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
 
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.
 
Back
Top