<asp:EntityDataSource ID="birth" runat="server" ConnectionString="name=SchoolEntities" DefaultContainerName="SchoolEntities" EnableFlattening="False" EntitySetName="CourseBirths" where = " it.[CourseNo] = 1 " select = "it.[CourseName], it.[StudentName], it.[Birth]"></asp:EntityDataSource>
The above code works perfectly with gridview to limit the rows to a specific CourseNo. However, if I want to limit the rows to students over a given age, how can I compare the date (Birth is a date field) in Birth to a specific date. I can't figure out how to format the compare date? the code would be something like: where="it.[Birth] > 01-01-2000" but this just throws an error. I tried using: DataFormatString="{0:MM-dd-yyyy}" to format the Birth Boundfield - this works fine for formatting in the grid, but doesn't help the compare. I've not been able to find any examples for how to format this comparison. I could deal with this in the code behind, but it seems like this should be easy in the aspx code.