Answered by:
WHERE Clause converting to nvarchar

Question
-
My scenario:
DB Table:
ID_Doc int PK
Doc varchar(14)
Entity:
Doc (String)
Query:
Dim QryDoc = (From Document In DBContext.TableDoc Where Documento.Doc = '114').First
Query Translated by LINQ:
SELECT * FROM TableDoc Where Doc = N'114'
Problem:
My TableDoc.Column it's varchar(14) and translating to nvarchar it's timeing out, I believe this translation is consuming everything because my table have 145 milions of rows.
Question:
Is there anyway to generate this LINQ query without the N' or have some sort of setting to disallow this convertion?
Angelo BestettiMonday, November 8, 2010 2:00 PM
Answers
-
Hi,
Take a look at this post:
http://stackoverflow.com/questions/1699382/linq-to-sql-nvarchar-problem
Hope this can help you,
JAReyes.
Please remember to Vote & "Mark As Answer" if this post is helpful to you.
Por favor, recuerda Votar y "Marcar como respuesta" si la solucion de esta pregunta te ha sido útil.- Marked as answer by Alex Liang Monday, November 15, 2010 5:51 AM
Monday, November 8, 2010 2:10 PM -
Hi Angelo,
What you required is improved in EF4.0, it will be not a problem if you are using EF4.0. You can refer to the following post to get more information.
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/d0b52cd9-768f-4fee-af65-53a164b9e61cBest regards,
Alex Liang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked as answer by Alex Liang Monday, November 15, 2010 5:51 AM
Tuesday, November 9, 2010 1:55 AM
All replies
-
Hi,
Take a look at this post:
http://stackoverflow.com/questions/1699382/linq-to-sql-nvarchar-problem
Hope this can help you,
JAReyes.
Please remember to Vote & "Mark As Answer" if this post is helpful to you.
Por favor, recuerda Votar y "Marcar como respuesta" si la solucion de esta pregunta te ha sido útil.- Marked as answer by Alex Liang Monday, November 15, 2010 5:51 AM
Monday, November 8, 2010 2:10 PM -
Hi Angelo,
What you required is improved in EF4.0, it will be not a problem if you are using EF4.0. You can refer to the following post to get more information.
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/d0b52cd9-768f-4fee-af65-53a164b9e61cBest regards,
Alex Liang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked as answer by Alex Liang Monday, November 15, 2010 5:51 AM
Tuesday, November 9, 2010 1:55 AM