我只想验证一些事情.我相信如果我将using命令应用于sqlDataReader,它将关闭数据读取器并处理它.例如:
Using sdr As sqlDataReader = cm.ExecuteReader() Dim someInt As Integer = sdr.GetInt32(0) 'other details and actions End Using
是.使用IDisposable.Dispose调用,MSDN page on SqlDataReader.Dispose说:
原文链接:https://www.f2er.com/vb/255097.htmlsqlDataReader.Dispose Method
Releases the resources used by the DbDataReader and calls Close.