Click here to Skip to main content
15,899,935 members
Home / Discussions / C#
   

C#

 
QuestionMessage Removed Pin
20-Feb-15 15:22
professionalDaniel Lieberwirth (BrainInBlack)20-Feb-15 15:22 
SuggestionMessage Removed Pin
20-Feb-15 21:56
mveRichard MacCutchan20-Feb-15 21:56 
GeneralMessage Removed Pin
20-Feb-15 22:09
professionalDaniel Lieberwirth (BrainInBlack)20-Feb-15 22:09 
GeneralMessage Removed Pin
20-Feb-15 22:50
mveRichard MacCutchan20-Feb-15 22:50 
AnswerMessage Removed Pin
20-Feb-15 22:16
mvePete O'Hanlon20-Feb-15 22:16 
GeneralMessage Removed Pin
20-Feb-15 22:31
professionalDaniel Lieberwirth (BrainInBlack)20-Feb-15 22:31 
GeneralMessage Removed Pin
20-Feb-15 22:53
mvePete O'Hanlon20-Feb-15 22:53 
GeneralMessage Removed Pin
21-Feb-15 9:02
mveGerry Schmitz21-Feb-15 9:02 
GeneralMessage Removed Pin
21-Feb-15 9:39
professionalDaniel Lieberwirth (BrainInBlack)21-Feb-15 9:39 
QuestionSelect Dates within a period of days Pin
RadioButton20-Feb-15 11:58
RadioButton20-Feb-15 11:58 
AnswerRe: Select Dates within a period of days Pin
Dave Kreskowiak20-Feb-15 12:39
mveDave Kreskowiak20-Feb-15 12:39 
AnswerRe: Select Dates within a period of days Pin
BillWoodruff20-Feb-15 12:56
professionalBillWoodruff20-Feb-15 12:56 
QuestionSearch in SQL tables using c# Pin
Wannabe Pro20-Feb-15 8:02
Wannabe Pro20-Feb-15 8:02 
GeneralRe: Search in SQL tables using c# Pin
PIEBALDconsult20-Feb-15 8:35
mvePIEBALDconsult20-Feb-15 8:35 
GeneralRe: Search in SQL tables using c# Pin
Wannabe Pro25-Feb-15 8:09
Wannabe Pro25-Feb-15 8:09 
QuestionHow do I make a MVC project appear properly in Visual Studio? Pin
Xarzu20-Feb-15 6:16
Xarzu20-Feb-15 6:16 
AnswerRe: How do I make a MVC project appear properly in Visual Studio? Pin
BillWoodruff20-Feb-15 12:43
professionalBillWoodruff20-Feb-15 12:43 
AnswerRe: How do I make a MVC project appear properly in Visual Studio? Pin
Gerry Schmitz20-Feb-15 12:47
mveGerry Schmitz20-Feb-15 12:47 
AnswerRe: How do I make a MVC project appear properly in Visual Studio? Pin
Afzaal Ahmad Zeeshan20-Feb-15 22:22
professionalAfzaal Ahmad Zeeshan20-Feb-15 22:22 
AnswerRe: How do I make a MVC project appear properly in Visual Studio? Pin
Simon_Whale23-Feb-15 5:53
Simon_Whale23-Feb-15 5:53 
Questionhow do i cut an image of an convex hull? Pin
neodeaths20-Feb-15 5:47
neodeaths20-Feb-15 5:47 
QuestionLinq Query : Translate Local Variables reference Pin
dilkonika19-Feb-15 13:50
dilkonika19-Feb-15 13:50 
Hello !
I'm using the information from this MSDN blog :
http://blogs.msdn.com/b/mattwar/archive/2007/08/01/linq-building-an-iqueryable-provider-part-iii.aspx[^]
to translate local variable references in linq queries.
Everything works very well except the case when I have a DateTime variable inside the query that I have to translate .

This is my case :

On my database I have the table orders where dt column have Date Type and store only the date.

Now if I have this query :
DateTime dt1 = Convert.ToDateTime("01/01/2012");
    var query = db.Orders.Where(c => c.dt == dt1);

If I try to translate , the returned expression is :
SQL
SELECT * FROM (SELECT * FROM Orders) AS T WHERE (dt = '01/01/2012 12:00:00
AM')

As you can see the translated query contains the time at the end , and my query everytime return no records.

What can I do that in translated query the value to be only the date without the time.?

I try many variants , I format the variable only to date format , but it's the same thing.

Thank you !
AnswerRe: Linq Query : Translate Local Variables reference Pin
Gerry Schmitz19-Feb-15 17:40
mveGerry Schmitz19-Feb-15 17:40 
GeneralRe: Linq Query : Translate Local Variables reference Pin
dilkonika19-Feb-15 17:54
dilkonika19-Feb-15 17:54 
GeneralRe: Linq Query : Translate Local Variables reference Pin
Gerry Schmitz19-Feb-15 19:05
mveGerry Schmitz19-Feb-15 19:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.