With two sequential "using", will both connections be disposed when exiting from {}?
using(OleDbConnection con = new OleDbConnection(conString))
using(OleDbCommand command = con.CreateCommand())
{
}
There's only one connection there - and a command using the same connection. Both will be disposed.
This is effectively:
using(OleDbConnection con = new OleDbConnection(conString))
{
using(OleDbCommand command = con.CreateCommand())
{
} // command will be disposed here
} // con will be disposed here
See more on this question at Stackoverflow