c# - Setting the LinqDataSource Where Clause using DateTime Column -
In C # .net, I have the following datasource setup that I dynamically assign a WHERE segment to the rear code Trying to ...
& lt; Asp: LinqDataSource ID = "LinqDataSource1" runat = "server" contextname = "MyNameSpace.DataClasses1DataContext" TableName = "MyTableWithADateTimeColumn" & gt; & Lt; / ASP: LinqDataSource & gt;
The code looks like something behind ...
LinqDataSource1.Where = "MyDateColumn == DateTime (" + date time.Now + ") ";
It gives me an error of the '' 'or', 'expected
I have tried to put it in quotation marks as well, as well From time to time and without the cast in the form of quotation marks ...
LinqDataSource1.Where = @ "MyDateColumn ==" + date time.Now + @ "" " ";
This gives me incompatible with the operand types, 'datetime' and 'string' , But I'm clear
Is it like that? What will happen about this now ...
LinuxDataSource 1. Where =" Maidat Column == Date Time The purse ("+ date time.Nob +") can not make a date in the construcker using string; pars () ...
Comments
Post a Comment