This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have converted my Database to firebird, and verified that ir works correctly (I used flamerobin) so I know my connection string is ok, and the database is fine. I have a problem connecting to the database from my app. I searched the providers folder in the lightspeed/providers folder, but there is no ADO.NET Firebird client .DLL there, so I downloaded the 2.1.0.0 version and included it in my project. I still does not work. Apart from my app, the designer gived the error that it cant load the .DLL (version 2.1.00) or one of it's dependencies. The version is correct, Is there a specific one I have to download from somewhere? When I run the app using the following simple query: var query = (from p in _unitOfWork.Gebruikers I get the following crash: System.Reflection.TargetInvocationException was caught I'm using a nightly build from about 2 weeks agoi. Any help would be appreciated. thx Anthony |
|
|
The Firebird ADO.NET client depends on a truckload of unmanaged DLLs: fbembed, icudt30, icuin30, icuuc30, msvcp71 and msvcr71. These all need to be in your application directory for FirebirdSql.Data.FirebirdClient to work. Could that be the problem? The "Dynamic SQL error / code -104 / Token unknown" error you report appears to be Firebird applying special handling to the name "Password". We have found in our testing that there seem to be certain column names that Firebird doesn't like ("Message" seems to be another one). We would suggest renaming this column in the database and applying the ColumnAttribute to map the entity's _password field to the renamed column (or, in the designer, setting the Column Name property). I will investigate the designer issue -- as previously mentioned Firebird designer support is not there because we did not previously have a VS2008 DDEX provider to test with. Because of this, I have a feeling that we did not try to install any Firebird designer support files, but I will be looking at this shortly. |
|
|
Ths for the speedy response :) This solved my problem for the designer (it does not work properly, but makes the connection to the DB at least) I renamed the "Password" field, but still get the folowing error: "GEBRUIKER" is the table i'm trying to query see crash info:
System.Reflection.TargetInvocationException was caught |
|
|
Can you turn on SQL logging and check the generated SQL against the database? The sort of things I would be thinking about are pluralisation (does the database have pluralised names -- probably not I guess since pluralisation would be using English language conventions which don't make sense for Dutch table names) and case sensitivity (I am not sure if Firebird is case-sensitive -- I thought not). Do other queries against the Gebruiker table work? Do queries against other tables work? |
|
|
It's the first query i'm firing against the database, it did originally complain when I tried to use a toLower(), so I suppose there is no case sensativity. this is the SQL it generates: SELECT |
|
|
Interestingly enough when I run that code in Flamerobin (perhaps there is no bearing at all) I get a very similar error.
The Flamerobin (Firebird opensource SQL manager) too generates code like this: SELECT a.ID, a."EmployeeName", a."LoginCode", a.WACHTWOORD, a."EMail", a."PreferredBaseColor", a."PreferredColor", a."IsAdministrator" perhaps not relevant at all, but then again, it may be....
|
|
|
I was thinking of case sensitivity of table names (i.e. Gebruiker vs. GEBRUIKER) rather than case sensitivity of comparisons. Does an old-style Find<Gebruiker>(Entity.Attribute("LoginCode") == "test") produce the same error? If you run this SQL via a normal Firebird client, does it come up with the same error? From your post about Flamerobin it sounds like Firebird is not finding the Gebruiker table rather than LightSpeed generating bad SQL... Can you sanity-check that the LightSpeedContext is hitting the correct database? Can you sanity-check that the database really does contain a Gebruiker table? I know these seem like dumb things to ask but I'm not sure why else Firebird would be reporting that it can't find the table even when you do the query through Flamerobin... |
|
|
I will try the .Find<> method tonight, but I can verify that the SQL Generated by Lightspeed fails to find the table "gebruikers" in the database, and produces a very similar/same error. It appears that the Table cannot be found in the database for some reason. However the SQL I posted above works, so it is something in the statement that does not get recognised by firebird. The lightspeedContext should be hitting the correct database, because I use the "same" connection string in Flamerobin, and in the Lightspeed designer, which works, and Yes, the Database definately has that table, I'v run SQL queries on the Firebird database, and it always worked in MS SQL before I converted the DB, but I have verified (as posted previously) that the DB is fine, and that I can make a connection to it, and I can retrieve the data from that table. Ill come back tonight with more tests.
|
|
|
Some concrete tests (All SQL queries I carriod out directly on the DB were using FlameRobin, when not using Lightspeed ================= Gebruiker person = user.UnitOfWork.Find<Gebruiker>().First(); results in the fiollowing SQL
|
|
|
Hi Anthony, Sorry for the delay in replying; for some reason the forums didn't notify me you'd posted. Perhaps I am being outstandingly dumb here, but it looks to me like your database table is called "dbo_Gebruiker" rather than "Gebruiker". Did you say the database had been imported from SQL Server? Could it be that the importer incorporated the schema name into the table name? If this is the case, then all you need to do is apply [Table("dbo_Gebruiker")] to your Gebruiker class -- or, assuming this is systematic, you could use an INamingStrategy to handle it automatically. Or if feasible you could try to reimport the database and persuade the importer not to prefix the SQL Server schema to the Firebird table name. Or am I missing something here? |
|
|
/sigh........ You are correct.. the conversion tool did indeed do that.... I'm sorry I wasted your time... But thx for the help once again. Anthony |
|
|
Nope, that still does not solve the problem, I made a hello world sample that I'm going to mail to you. |
|
|
Hi Anthony, Have had a quick look at the sample you mailed through and can see a few issues with the sample :) Firstly, the database needs to have the ID column named as "Id" rather than "ID" - this is due to the LightSpeed conventions. Alternatively you can set the Identity Column Name to ID in the Designer or on the Table attribute of the entity class - this is likely your preferred approach. Secondly you had a couple of fields defined in the table which were misaligned with the model. Not sure if this is due to the sample database, but I cleaned them out. The fields were WachtWoord and IsAdministrator. Lastly, Firebird is expecting the fields to be quoted. Make sure you set QuoteIdentifiers to be true in your configuration or on the LightSpeedContext object. e.g. context.QuoteIdentifiers = true; I will email you back the updated sample code so you can verify it locally :)
Jeremy
|
|
|
With youw help im up and running at last :)
thx so much |
|
|
[quote user="antprog"]I have a problem connecting to the database from my app. I searched the providers folder in the lightspeed/providers folder, but there is no ADO.NET Firebird client .DLL there, so I downloaded the 2.1.0.0 version and included it in my project. I still does not work.[/quote] [quote user="ivan"]The Firebird ADO.NET client depends on a truckload of unmanaged DLLs: fbembed, icudt30, icuin30, icuuc30, msvcp71 and msvcr71. These all need to be in your application directory for FirebirdSql.Data.FirebirdClient to work. Could that be the problem?[/quote] Today I had similar problem like andprog. I was trying to generate database model using lsgen.exe and I was getting missing Firebird 2.1.0.0 DLL. When I found it in internet and installed locally it started to work. |
|