.NET Daily

Common .NET Exceptions

Cannot implicitly convert type ‘System.Data.Linq.Binary’ to ‘byte[]’

Posted on .

Cannot implicitly convert type ‘System.Data.Linq.Binary’ to ‘byte[]’

Introduction

Error: Cannot implicitly convert type ‘System.Data.Linq.Binary’ to ‘byte[]’

Scenario 1: You have created an sql table in the database with a field of type “byte[]”. Then you have imported that table in a .dbml file. When you try to use the mapped object in code, you get the error above.

Cause of Scenario 1: When a table with a byte[] field is imported into a .dbml file, Visual Studio automatically change the type of that byte[] field to a Linq.Binary field.

Resolution for Scenario 1: Click on the Binary field from .dbml file, open properties and then change the field type from Binary to byte[].

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.

There are no comments.

View Comments (0) ...
Navigation

Privacy Preference Center