Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. bindingsource.filter syntax question

bindingsource.filter syntax question

Scheduled Pinned Locked Moved C#
wpfwcfcomhelptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    crash893
    wrote on last edited by
    #1

    I've done some looking around and I'm a bit confused Here is an example of the data that's in the binding source [IMG]http://i38.tinypic.com/xfoimp.png\[/IMG\] what i want to do is sort on the 3rd row ( 4 or 3) and then sort by the date ( to see if the record is before a certian time my idea to do this was to filter the BS BS.count then unfiltered the BS The problem i keep running into is that i cant say that i want Just 4 or Just 3 What I've come up with so far is

    private int deadlineCount(DateTime Time, int LeagueID)
    {
    int total = 0;
    string league;
    if (LeagueID == 99)
    {
    league = "";
    }
    else
    {
    league = LeagueID.ToString();
    }

            BS.Filter = string.Format("LeagueID >= '{0}' and LeagueID <= '{0}'and \[End\] <#12/30/1899 {1}#", league, Time.ToString("h:mm tt"));
            total = BS.Count;
            BS.Filter = "";
            
            return total;
        
        }
    

    But i keep running into problems that i cant use any operator ( like ,> ,= ,>=,) becuase it can not preform X onn system.int32 and system.string. I've been looking around but all the example seem to be for strings or dates.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups