Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have so many queries that have to be executed one by one. i did it by using
C#
using (OdbcConnection connection = new OdbcConnection(Connectionstring))
   {
      using (OdbcCommand queryCommand = connection.CreateCommand())
        { }
      using (OdbcCommand queryCommand = connection.CreateCommand())
        { }
   }


I think it is more helpful if i can execute these sequence of queries as a script. Is their any possibility to execute such sequence of queries as a script. and have to use transaction also.
Posted
Comments
Maciej Los 4-Mar-15 9:11am    
If it's set of commands, why don't you use loop?
Sergey Alexandrovich Kryukov 4-Mar-15 14:35pm    
Sorry, Maciej, where can you see a loop?
—SA
Maciej Los 4-Mar-15 14:38pm    
Everywhere ;) But seriously... If there is a set of commands, one way to execute sequence of queries is to use loop. Am i wrong?
Sergey Alexandrovich Kryukov 4-Mar-15 14:51pm    
Ah, you said "why don't"; I misread it, sorry. Yes, you are right, why not? :-)
That said, I don't see a question in this question. :-)
—SA
Maciej Los 4-Mar-15 15:01pm    
Yeah, this "question" makes no sense - at this moment. First of all, we don't know what kind of queries OP wants to run and why He/She wants to use transaction. On the other side, executing set of queries in a loop is bad from performance point of view.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900