Connecting Tech Pros Worldwide Forums | Help | Site Map

How to have multiple statements in one query using iDB2Command in .Net

Newbie
 
Join Date: Jul 2009
Posts: 1
#1: Jul 23 '09
Hi

I need to have a single query and which can have multiple statements

For eg:
string str = string.Empty;
str = "select * from Customers;Select * from Orders";

iDB2Connection iDB2con = new iDB2Connection(connStr);
iDB2Command iDBCmd = iDB2con.CreateCommand();
iDBCmd.CommandText = str;
iDBCmd.ExecuteNonQuery();

I get the Error:

SQL0104 Token ; was not valid. Valid tokens: <END-OF-STATEMENT>.


Can any one please let me know how to have multiple statements in one query.

Thanks In Advance.

Reply