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.CloseConnect ion);
}
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. 4 4218
Hi Junior,
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"
I haven't used Firebird (though I have used InterBase), but shouldn't your
SELECT statement be:
"SELECT DISTINCT unity FROM products"
I.e. DISTINCT is not a function but a keyword. Check your SQL reference if
this is the case. If this doesn't help, then we would need the error message
given by ExecuteReader().
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland ja***@removethis.dystopia.fi http://www.saunalahti.fi/janij/
Hi. The statement is correct. I've made a test in the EMS SQL Manager
tool and it works. But when executing the statement inside the .Net
doesn't work. And there's no error message, the application just keeps
"stuck"... and must shutdown with Ctrl+Alt+Del... and the ExecuteReader
method that is crashing the application, and I don't know why...
Thanks.
Junior
Jani Järvinen [MVP] escreveu:
Hi Junior,
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"
I haven't used Firebird (though I have used InterBase), but shouldn't your
SELECT statement be:
"SELECT DISTINCT unity FROM products"
I.e. DISTINCT is not a function but a keyword. Check your SQL reference if
this is the case. If this doesn't help, then we would need the error message
given by ExecuteReader().
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland ja***@removethis.dystopia.fi http://www.saunalahti.fi/janij/
Hello again. I discovered that is a problem related to the embedded
version of Firebird.
I made a test with the server version of Firebird, and it works now.
Thanks for your time.
Junior
osmarjunior escreveu:
Hi. The statement is correct. I've made a test in the EMS SQL Manager
tool and it works. But when executing the statement inside the .Net
doesn't work. And there's no error message, the application just keeps
"stuck"... and must shutdown with Ctrl+Alt+Del... and the ExecuteReader
method that is crashing the application, and I don't know why...
Thanks.
Junior
Jani Järvinen [MVP] escreveu:
Hi Junior,
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"
I haven't used Firebird (though I have used InterBase), but shouldn't your
SELECT statement be:
"SELECT DISTINCT unity FROM products"
I.e. DISTINCT is not a function but a keyword. Check your SQL referenceif
this is the case. If this doesn't help, then we would need the error message
given by ExecuteReader().
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland ja***@removethis.dystopia.fi http://www.saunalahti.fi/janij/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ralph Freshour |
last post by:
I have a question about the following PHP script - I got it off a web
site tutorial on how to count users logged into your site - my
question is the $PHP_SELF variable - it writes the name of the...
|
by: Jacek |
last post by:
Hi, can anyone shed some light on this issue?
SELECT Status from lupStatus
with a normal query it returns the correct recordcount
SELECT Status from lupStatus GROUP BY Status
but with a GROUP...
|
by: Alex Satrapa |
last post by:
I have a table from which I'm trying to extract certain information. For
historical reasons, we archive every action on a particular thing
('thing' is identified, funnily enough, by 'id'). So the...
|
by: mathilda |
last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than
SELECT all other factors being equal. I disagree. We are linking an
Access front end to a SQL Server back end and normally are...
|
by: www.FreelanZ.nl |
last post by:
I am trying to get the embedded Firebird database in my VB.NET app. I
already have the dll, but i can't get it running..
Has anyone an example for me ? This would help a lot. Can't find any on...
|
by: Ann Harrison |
last post by:
Tom,
Actually, I've never had a corrupted firebird database. There were
two bugs in an older version of InterBase that produced income for me.
The first was a failure to realize that a file had...
|
by: timothy.williams |
last post by:
Hi.
I have a Python program that parses a file and inserts records into a
database with MySQLdb. I recently upgraded to MySQL 5.0.8, and now my
parser runs *really* slow. Writing out to CSV...
|
by: Bob Stearns |
last post by:
I am getting unwanted duplicate rows in my result set, so I added the
DISTINCT keyword to my outermost SELECT. My working query then returned
the following message:
DB2 SQL error: SQLCODE: -214,...
|
by: Krish |
last post by:
Hi
I am validating using the firebird Embedded DB with .NET.
has anyone used it with .NET and would like to share his/her
experiences about the same?
Kris
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |