P
pvong
Newbie doing this in VB.NET
I have a simple "USING" to create my DataReader. I end it with END USING
and I know this will close the connection. Will this close my dr also or do
I need to add dr.close() ever time?
Thanks!
Phil
Using cn As IDbConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)Dim
cmd As New SqlCommand("SELECT Statement", cn)
cn.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.SingleRow)
dr.Read()
Reading my stuff here.
[do i need a dr.close() here?]
End Using
I have a simple "USING" to create my DataReader. I end it with END USING
and I know this will close the connection. Will this close my dr also or do
I need to add dr.close() ever time?
Thanks!
Phil
Using cn As IDbConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)Dim
cmd As New SqlCommand("SELECT Statement", cn)
cn.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.SingleRow)
dr.Read()
Reading my stuff here.
[do i need a dr.close() here?]
End Using