Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to filter data in a dataview before binding to datag
Message
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00673397
Message ID:
00673483
Views:
16
Hi Kirk,

How about you change the stored procedure to return two extra columns that convert the schedfrom and schedto to two DateTime fields.

This way you can simply specify the filter to be:
openslotstart >= New_SchedFrom and openslotstart <= New_SchedTo

On the other hand, if the sp is used extensively you might want to simply add two columns to the datatable ar run time using
oTable.Columns.Add("New_SchedFrom", typeof(DateTime));
, and then update the contents via a method.

Kamal


>I have a resultset returned from a stored procedure with the following fields:
>
>
>----------------------------------------------------
>roomname,schedfrom,schedto,  openslotstart,    openslotend
>OR 1        700      1700   07/15/2002 17:01  07/15/2002 18:01
>OR 2        700      1700   07/15/2002 07:00  07/15/2002 08:01
>
>
>
>I need to be able to filter the result to display only rows where the hour portion of the OpenSlotStart is between the schedfrom and schedto.
>
>I tried the dataview.RowFilter but I can't figure out the right way to work it.
>
>
>            oCommand.Connection = oConn
>
>            dvRooms = VFPToolkit.vfpData.SqlExecute(oConn, oCommand, "deptview")
>            VFPToolkit.vfpData.SqlDisConnect(oConn)
>
>            dvRooms.RowFilter = "datepart(DateInterval.Hour,OpenTimeEnd)*100 < OpenTimeEnd"
>
Previous
Reply
Map
View

Click here to load this message in the networking platform