LinqConnect to MsSql

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

LinqConnect to MsSql

Post by Zero-G. » Tue 19 Nov 2013 14:51

Hey

I use the following SQL Statement:

Code: Select all

Dim fachgebiet = From Query In myEldaContext.Fachgebiets _
                                 Select Id = Convert.ToInt64(Query.Wert), Beschreibung = Query.Beschreibung
it is getting translated to this:

Code: Select all

SELECT [t1].[Feld1] AS [C1], [t1].[Feld2] AS [Beschreibung]
FROM [dbo].[Fachgebiet] [t1]
-- Context: Devart.Data.SqlServer.Linq.Provider.SqlDataProvider Mapping: AttributeMappingSource Build: 4.4.374.0
Why is this? - I Need the field called ID not C1

THX

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect to MsSql

Post by MariiaI » Tue 19 Nov 2013 16:24

This is the generated SQL query, which corresponds to the LINQ query being performed. The principle of generating is based on the different rules and conditions. This does not affect the result you are getting in your application. With this query you should eventually get this:

Code: Select all

(0) = Id="1", Beschreibung="test"
(1) = Id="4", Beschreibung="test"

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Re: LinqConnect to MsSql

Post by Zero-G. » Tue 19 Nov 2013 16:40

Hey

I have sended you a sample Project where you can find the error.

THX

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect to MsSql

Post by MariiaI » Wed 20 Nov 2013 11:02

Thank you for the sample project. We have reproduced the "Specified cast is not valid" error (ToInt64,ToInt32). We will investigate it and inform you about the results as soon as possible.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect to MsSql

Post by MariiaI » Fri 13 Dec 2013 06:27

The bug with the data type conversions during materialization is fixed.
New build of LinqConnect 4.4.393 is available for download now!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=28506.

Post Reply