[simplified] Reusability of objects in MySQL Connector/NET

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

My previous post may be too confusing. This is the idea of my doubt:

To do one single SELECT-type query, or one single INSERT-type query, I
have no problems.

To do multiple queries in a row, which objects can I reuse? Do I need
to instantiate a new connection (MySqlConnection) object, a new
command (MySqlCommand) object, and a new data reader (MySqlDataReader)
object for each and every query? I guess this would work, but would it
would be optimum in terms of time and resources? I tend to think it
would not.

Can I at least reuse the connections? I hope the answer to this is
"yes".

Can I reuse an instance of MySqlCommand in two queries in a row? This
is where my serious doubts start.

Can I reuse an instance of MySqlDataReader, too?


Thanks for your help.
Mochuelo.
.



Relevant Pages

  • Excel Dates - Comparison Operator Issue
    ... I am using this field to try to query a dataset that I have on another ... absolute reference in my calculation to reuse the value in A1, ... and combine it with a comparison operator?? ...
    (microsoft.public.excel.misc)
  • Re: parameter queries
    ... "John Vinson" wrote: ... but you can reuse the parameter as many ... > times as needed within the query. ... Just spell it exactly the same way ...
    (microsoft.public.access.queries)
  • Re: Multiple results by a single prepared statement..
    ... you get multiple rows back. ... you ran reuse the PreparedStatement for another query. ... the same query since the method signature does not allow for it. ...
    (comp.lang.java.databases)
  • RE: Calculating dates excluding weekends/holidays?
    ... e.g. if I have a part returned to me on 7-25-04 and I do not want to reuse it for 3 months, how do I make this happen? ... "Mark" wrote: ... > I am trying to figure out how to make a query that will ... > weekends or holidays. ...
    (microsoft.public.access.queries)
  • Re: parameter queries
    ... but you can reuse the parameter as many ... times as needed within the query. ... Just spell it exactly the same way ... Come for live chats every Tuesday and Thursday ...
    (microsoft.public.access.queries)