I think you said before on another thread that it is "bad practice" to use an explicit connection in combination with a SqlDataAdapter. I don't believe that it is true, and consequently, I don't agree with it.
The Adapter is capable of making sure it has a valid connection; however, there is nothing wrong with creating an explicit connection that you use for one or more dataadapters.
If you take a look
here (constructor for an Adapter) you'll see that you can pass in a connection object that is already open. Only you are responsible for closing it again.
So, something like this is perfectly legal and "good practice"
Conn.Open()
// Do whatever you need to do with the connection
// Start a transaction, create and use adapters, whatever
// Continue doing that
Conn.Close()
So, even if the Adapter
can handle the connection itself, you can also feed it an existing and open connection.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.