O
osmarjunior
Hi. I made a method to execute queries in my database (Firebird
embedded v.1.5.3).
The Database class contains methods to create the database specific
objects.
public static DbDataReader ExecuteReader(String query)
{
// Creates the DbCommand
DbCommand command = Database.GetCommand();
// Creates the DbConnection and open it
command.Connection = Database.GetConnection();
// Obtains the SQL query text
command.CommandText = query;
// Execute the query and return the DataReader
return command.ExecuteReader(CommandBehavior.CloseConnection);
}
At first, all the queries runs ok, except if I use the distinct clause.
The following query works perfectly:
"SELECT unity FROM products"
The following query does not work, and the method ExecuteReader crashes
(like being processing something, and never leaves the scope):
"SELECT DISTINCT(unity) FROM products"
Any idea what it can be?
Regards.
Junior.
embedded v.1.5.3).
The Database class contains methods to create the database specific
objects.
public static DbDataReader ExecuteReader(String query)
{
// Creates the DbCommand
DbCommand command = Database.GetCommand();
// Creates the DbConnection and open it
command.Connection = Database.GetConnection();
// Obtains the SQL query text
command.CommandText = query;
// Execute the query and return the DataReader
return command.ExecuteReader(CommandBehavior.CloseConnection);
}
At first, all the queries runs ok, except if I use the distinct clause.
The following query works perfectly:
"SELECT unity FROM products"
The following query does not work, and the method ExecuteReader crashes
(like being processing something, and never leaves the scope):
"SELECT DISTINCT(unity) FROM products"
Any idea what it can be?
Regards.
Junior.