views:

134

answers:

0

I am using a code generator called SmartCode Studio to generate the database layer for a ASP.NET application. The generated code uses NHibernate to talk to the database.

This has worked well in the past when we used SQL Server. SmartCode retrieves the SQL data types from the database and determines the correct corresponding .NET data types.

However, we we are now going to change from SQL Server to MySQL. When using MySQL SmartCode fails to determine the correct SQL data types, it shows them as Uknown, and generates everything as System.String instead.

The interesting thing is that it also shows OriginalSQLType for each column and there it correctly displays the type I have defined in the database.

Here is how it would show up in the program for a few example types when using SQL Server:

  OriginalSQLType    nvarchar          smallint         datetime
  SQL Type           VarChar           Int16            DateTime
  Net Data Type      System.String     System.Int16     System.DateTime

And here is what it shows when using MySQL:

  OriginalSQLType    varchar           smallint         datetime
  SQL Type           Unknown           Unknown          Unknwon
  Net Data Type      System.String     System.String    System.String

Does anyone have any idea on what I'm doing wrong?