The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Unknown datatype

Last post 06-19-2008, 4:40 AM by Mike.Griffin. 11 replies.
Sort Posts: Previous Next
  •  06-03-2008, 6:00 AM 9584

    Unknown datatype

    Hi,

    I have big problems with "Unknown" as datatype. I did try everything mentioned here, reinstalled my OS (tried vista and XP), recreated databases, but nothing seems to work. I noticed first the problem on SQL2005 database, so I migrated it to VistaDB3, but this did not help anyway.

    Im running with MyGen1303 (tried also 1207) + ES.2008.0518 + SQL2005 Express SP2 (VistaDB 3.3.1.57) and Im generating the code to target multiple databases.

    Maybe you have a idea what can be wrong. Thanks in advance for any advice.

     

     

  •  06-03-2008, 9:15 AM 9588 in reply to 9584

    Re: Unknown datatype

    Where are the unknown types? When generating against VistaDB? We need more information

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-03-2008, 10:58 AM 9593 in reply to 9588

    Re: Unknown datatype

    Every field in Entity class is of type Unknown. Language and DBType mappings seems to be ok. Yes I'm generating against latest stable VistaDB, but have the same problem when I build against SQL 2005 Express.
  •  06-03-2008, 11:47 AM 9595 in reply to 9593

    Re: Unknown datatype

    [solved]

    Ok, I followed the advice from some other thread and copied the esSettings.xml from EX2008 to MyGeneration\Settings directory and now everything is working again. 

  •  06-15-2008, 8:30 AM 9816 in reply to 9595

    Re: Unknown datatype

    Sorry, but I have to reopen this again. I installed the newest version and again it doesn't resolve DataTypes. The strange think is, it works perfect only if I create new project, as soon as I save it and reopen it doesn't work anymore. My 'workaround' from latest beta doesn't work anymore. Here a short snipet:

    Code:
    #region LoadByPrimaryKey
    public virtual bool LoadByPrimaryKey(Unknown id)
    {
    if(this.es.Connection.SqlAccessType == esSqlAccessType.DynamicSQL)
    	return LoadByPrimaryKeyDynamic(id);
    else
    	return LoadByPrimaryKeyStoredProcedure(id);
    }

    every single field in table is of type Unknown. Strange. If you need anything from me, to track this down, I will make some test project.

  •  06-15-2008, 10:45 AM 9818 in reply to 9816

    Re: Unknown datatype

    Are you talking about a MyGeneration project, or a Visual Studio project?
    David Neal Parsons
    www.entityspaces.net
  •  06-15-2008, 1:17 PM 9820 in reply to 9818

    Re: Unknown datatype

    Sorry, I'm talking about mygeneration project.
  •  06-18-2008, 3:07 PM 9879 in reply to 9820

    Re: Unknown datatype

    Please, I'm still sticking on this. I have a simple test project, can I send it to someone?
  •  06-18-2008, 9:05 PM 9882 in reply to 9879

    Re: Unknown datatype

    Please zip up your test project and send it to support@entityspaces.net.


    David Neal Parsons
    www.entityspaces.net
  •  06-19-2008, 2:43 AM 9883 in reply to 9879

    Re: Unknown datatype

    We received your test project, but I cannot duplicate your issue under Win XP with the latest ES 2008.0.0611.0 release candidate, MyGen 1.3.0.3, and VistaDB 3.3.1.57.

    I started with a clean ES slate... un-installed all versions of ES, manually deleted any left over ES Program and template folders in Windows Explorer, and deleted all ES xml files from the MyGeneration13 Settings folder. I then downloaded and installed the ES release candidate from the "Products | Downloads" forum on our site. I even added a batch file to my StartUp folder that did a "subst u: c:\drive_u", so that I could set up your folder structure, copy your test db file there, and run your project, without alteration, rather than my own.

    MyGeneration and VistaDB were already installed, and MyMeta.Plugins.VistaDB3x.dll had been recompiled and copied to the MyGen13 folder. I was able to successfully test a connection to your test db in MyGen default settings, so I did not have to un-install, or re-install MyGeneration, nor did I have to manually copy esSettings.xml or any other file.

    I just took the default installation for ES, opened your project in MyGen, and executed it. The generated file had correct data types for LoadByPrimaryKey and all 3 properties, just like the CodeSmith generated file in your Generated folder. Closing and opening the Project, or MyGeneration did not affect the outcome. The file was always generated correctly.

    Code:
    /*
    ===============================================================================
                        EntitySpaces(TM) 2008 by EntitySpaces, LLC
                 Persistence Layer and Business Objects for Microsoft .NET  
                              http://www.entityspaces.net
    ===============================================================================
                           EntitySpaces Version # 2008.0.0611.0
                           MyGeneration Version # 1.3.0.3
                           Date Generated       : 6/19/2008 4:31:20 AM
    ===============================================================================
    */
    // ...
    		#region LoadByPrimaryKey
    		public virtual bool LoadByPrimaryKey(System.Int32 id)
    		{
    			if(this.es.Connection.SqlAccessType == esSqlAccessType.DynamicSQL)
    				return LoadByPrimaryKeyDynamic(id);
    			else
    				return LoadByPrimaryKeyStoredProcedure(id);
    		}
    // ...

    The only settings file installed to the MyGeneration Settings folder is esLanguages.xml, and that is what determines data type mappings. If you can successfully connect to your db in MyGen default settings, then you should be able to generate files correctly from your project. Even if at a later date you change to different default settings, the project should still run correctly against the VistaDB file. esSettings.xml and esUserData.xml are only required if you need to change something from the default, such as stored procedure prefixes, or column aliases. They are created on first use of the ES Settings or UserData templates. If they do not exist, the defaults apply.

    Unless this is a Windows Vista UAC issue, I'm not sure what else to check. If you are on Vista, make sure you right-click and install as administrator. When running MyGen, also, right-click and run as administrator.


    David Neal Parsons
    www.entityspaces.net
  •  06-19-2008, 4:07 AM 9884 in reply to 9883

    Re: Unknown datatype

    I did the same procedure many times (under Vista and XP SP2), nothing is working until now.

    If I open the project, Language.xml is selected. Ok, I select esLanguage.xml ... there is no Language definition for VistaDB3 :(, I'm using Languages.xml with C# Language definition.

    Under MyMeta Properties are filled all fields with Types (only DataTypeNameComplete is empty).

    The only workaround I know this time, is to make new Project, then it works once, this is very annoying ... Under CodeSmith it's working perfect (i tested yesterday with trial).

  •  06-19-2008, 4:40 AM 9888 in reply to 9884

    Re: Unknown datatype

    We are sorry about this. The idea is that ES2009 will ship with a built in Code Generator and you will be freed from using MyGeneration / CodeSmith if you so choose. It will be so much easier and we will be in control of everything. All aspects will be so much easier.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML