I tried bind a AspxGridView by LinqDataSource

But I get this error : LINQ to Entities' System.DateTime Parse (String) method, this method does not recognize and can not be converted into a store expression.

How can I set a where condition for lnqTransferOrder ?

     private void BindGrid()

     { 

      this.lnqTransferOrder.Where = "DateScheduled >= DateTime.Parse(\"" + this.dtTranferDateFirst.Date.ToString() + "\")&&DateScheduled < DateTime.Parse(\"" + this.dtLastDate.Date.ToString() + "\") && Statues!=5";


        gridTransferOrder.DataBind();

     }

Aspx

      <asp:LinqDataSource ID="lnqTransferOrder" 
      ContextTypeName="MyApp.MyAppEntities"  TableName="TransferOrder" 
       runat="server" ondeleting="lnqTransferOrder_Deleting"  
       OnInserting="lnqTransferOrder_Inserting" OnUpdating="lnqTransferOrder_Updating"
        Where="Statues==0" EntityTypeName="">
       </asp:LinqDataSource>
0

There are 0 best solutions below