We're updating the issue view to help you get more done. 

String concatination with numeric value leads to invalid SQL

Description

When selecting a column produced by a string concatination the resulting SQL is invalid.

Consider following VB.net code:

The resulting SQL is

This statement produces an error Conversion failed when converting the varchar value 'Chauseestrasse 3' to data type int.

To get a valid SQL I've to write my query like

Resulting SQL

Please implement a recognition of those operations to always create the "conversion" SQL.

Activity

Show:
Michael Ketting
February 5, 2016, 2:43 PM

Note: This affects both VB.NET and C# statements.

Michael Ketting
February 5, 2016, 3:24 PM
Edited

See BinaryExpressionSqlBackendIntegrationTest.StringConcatenation for a sample of the wrong behavior. It looks like the integration test missed this as being not the correct /intended behavior.

Michael Ketting
February 5, 2016, 3:41 PM

Likely, there is a second problem in the re-linq frontend's partial evaluation: when concatenating a const int to a string property, the conversion is lost in the querymodel's select expression. The conversion still exists when concatenating properties, not that it helps much.

Assignee

Unassigned

Reporter

User known

Labels

None

Components

Fix versions

Affects versions

Priority

Normal
Configure