SqlClient.SqlConnection.CreateCommand and an open connection?

I have an application (VB.net) which has two routines that process nonquery SQL command requests.

One routine queues commands up as they come in and the other pulls them out of the queue on a timed basis FIFO style. I essentially just pre-create a SQL command, enqueue it, and then execute it when it gets pulled from the queue.

My question is this: does SqlClient.SqlConnection.CreateCommand require a specific connection string to create a command or can that be left for when the command is actually processed?

Due to the asymmetric nature of the processing of these commands I would prefer only to have to open connections to the database on the executing end. The examples I have seen all show a command being created with a specific connection string and usually an opened connection.

I can provide code snippets but I really just need to find out what is mandatory in order to create a SQL command.
LVL 1
kkammAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
what about just using

dim cmd as SqlClient.SqlCommand = new SqlClient.SqlCommand
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
and yes, you can provide the connection object at a later time.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kkammAuthor Commented:
That is what I thought but I just wanted to make sure before changing a bunch of code. Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.