tags:

views:

174

answers:

3

Hi I'm running subsonic 3 when trying to call a stored procedure ( sp.ExecuteTypedList() ) I get the error :

Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query.

Any idea on how to fix this ?

+2  A: 

I'm pretty sure it's a bug. I logged an issue last night: http://github.com/subsonic/SubSonic-3.0/issues#issue/29

John Sheehan
The ticket was just updated by Rob to say it's fixed. I haven't tested yet though.
John Sheehan
+2  A: 

Fixed this today - will have a push in the next few days.

Rob Conery
+1  A: 

In the mean time here is a solution from John's suggestion

in StoredProcedures.tt

change the line

sp.Command.AddParameter("<#=par.Name#>",<#=par.Name#>);

to

sp.Command.AddParameter("<#=par.Name#>",<#=par.Name#>, DbType.<#= GetDbType(par.SysType)#>);
freddoo