6398

subsonic 3 - Object of type 'System.Byte[]' cannot be converted to type 'System.Strin

Question:

I have this piece of code that works fine in subsonic 2.2, I migrated to subsonic 3 but now i get this error 'Object of type 'System.Byte[]' cannot be converted to type 'System.String'.' subsonic 2.2 code in comment

public IList<Tag> Tags { get { return Tag.Find(t => t.TypeId == 1 && t.ItemID == JobId).ToList(); // new TagCollection().Where(Tag.Columns.TypeId, 1) // .Where(Tag.Columns.ItemID, JobId).Load(); } }

Where TypeId and ItemId are int how can this be fixed ?

Answer1:

Are you using the latest version (3.0.0.1), what you're reporting looks very similar to:

<a href="https://stackoverflow.com/questions/1092796/subsonic-3-invalid-cast-from-system-byte-to-system-byte" rel="nofollow">Subsonic 3: Invalid cast from 'System.Byte' to 'System.Byte[]'</a>

Also which database are you using?

Answer2:

i'm using 3.0.0.0

the error is similar

in SQLServer.ttinclude, missing sql type "timestamp"

where you see

string GetSysType(string sqlType){ ... case "image": case "binary": case "varbinary": sysType= "byte[]"; break; ... }

change to string GetSysType(string sqlType){ ...

case "image": case "binary": case "varbinary": case "timestamp": sysType= "byte[]"; break; ... }

Answer3:

i have run into same issue however needed to add the following case to MySQL.ttinclude template:

case "image": case "binary": case "varbinary": --> case "longblob": <-- sysType= "byte[]"; break;

Recommend

  • Super-weird issue triggering “Segmentation Fault”
  • How to get the name of userfiles in controller to add to database
  • Passing values from one jsp page to another jsp page
  • Set transient value from database with Spring Data JPA
  • A quick question about aggregate relational objects in MVC
  • Obtaining the type-name of a template type, without class definition
  • Nativescript Switch prevent change event firing on initial binding
  • angularjs how to remove duplicates by multiple select
  • Deep copy Objective C objects with UIImageView as property
  • Display Table form with Eloquent Data Laravel
  • golang fails to parse json for reflection created object
  • Possible race conditions when creating and updating a struct in the same request - coldfusion
  • MySQL multiple IN conditions to subquery with same table
  • Is it possible to get the word under the mouse cursor in a ``?
  • BeautifulSoup difference between findAll and findChildren
  • NHibernate manually control fetching
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Loading .coffee files via a view in Rails
  • Create DicomImage from scratch using Dcmtk
  • Get one-time binding to work for ng-if
  • Volley JsonObjectRequest send headers in GET Request
  • Importing jscolor library in angular 2
  • Rearranging Cells in UITableView Bug & Saving Changes
  • Circular dependency while pushing http interceptor
  • Linker errors when using intrinsic function via function pointer
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • Django query for large number of relationships
  • Why is Django giving me: 'first_name' is an invalid keyword argument for this function?
  • Observable and ngFor in Angular 2
  • How can i traverse a binary tree from right to left in java?
  • How to Embed XSL into XML
  • How can I use `wmic` in a Windows PE script?
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?
  • How to push additional view controllers onto NavigationController but keep the TabBar?
  • How to load view controller without button in storyboard?