some types are not supported?

Jun 30, 2012 at 11:37 AM

context.Update("Table").Column("Col1", value).Where("ID", 1).Execute();

if value is nullable like decimal?, float?, it will cause an error.

and value is float or double type, it will cause an error too...

Coordinator
Jul 1, 2012 at 9:17 AM

I have checked the code. It seems the fix I did to solve this issue was not optimal. I have a better fix that will finally solve this, but I'm on holiday until Thursday so I won't get to fix this until Thursday evening. I will notify you when it's fixed.

Coordinator
Jul 11, 2012 at 6:25 AM

What database do you use? Can you please paste your database table and your .NET code? Then I can verify that the fix works...

Jul 11, 2012 at 8:38 AM

Mysql5.5 and Sql Server 2005.

Example:

Table Structure:

----MySql-----

 

CREATE TABLE `table1` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `C1` float DEFAULT NULL,
  PRIMARY KEY (`ID`)
)

 

-----Sql Server----

C1 is a Real.

Code:

 

FluentData.IDbContext context = new FluentData.DbContext().ConnectionString("server=localhost;User Id=root;password=111;Persist Security Info=True;database=test", FluentData.DbProviderTypes.MySql);

float c1 = 12.12F;
context.Insert("Table1").Column("C1", c1).ExecuteReturnLastId();

 

 

Error: The parameter c0 is of a type that is not supported.

Besides, InsertBuilder has no method 'Execute' ? I always use Guid for the key..

Coordinator
Jul 11, 2012 at 6:37 PM

This issue should hopefully be fixed now. I tested it against SQL-Server and it works. I've made a new release for you, it's marked as beta since there are some new functionality in there (a Select builder that might not be 100% stable yet). Get it from:
http://fluentdata.codeplex.com/releases/view/90977

I will be on holiday for the next 2 weeks. When I'm back I will will make a new stable release.

Coordinator
Jul 11, 2012 at 8:11 PM

... And Execute() has been added to the InsertBuilder.