Which is faster?

ManicCW

Well-known member
Joined
Jul 21, 2005
Messages
428
Location
Mostar
Programming Experience
Beginner
I need to retrive data from database and i need it to be fast so im trying to optimize code. If I use 3 datareaders to retrive data is it better to use this:

cn.open()
dr.open()
dr.close()
dr.open()
dr.close()
dr.open()
dr.close()
cn.close()

or this:
cn.open()
dr.open()
dr.close()
cn.close()

cn.open()
dr.open()
dr.close()
cn.close()

cn.open()
dr.open()
dr.close()
cn.close()
 
Back
Top