in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Using DataLibrary with Filters

Last post 03-20-2008 12:11 AM by siacom. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-20-2008 12:11 AM

    • siacom
    • Not Ranked
    • Joined on 11-16-2007
    • Newcastle Australia
    • Posts 1

    Using DataLibrary with Filters

    VB .NET

    From an example I have used this code in my DataClass

    If e.TableView.Name = "WebLinks" Then  
        Dim Command As OleDbCommand = New OleDbCommand( _ 
        "SELECT LinkID, StaffID, LinkText, DisplayForAll, HTTPaddess" + Chr(10) + _
        "FROM WebLinks " + Chr(10) + _ 
        "WHERE (StaffID = " + e.Filter(0).ConditionText + ") " + _
     
        "AND (DisplayForAll = 1)" , _
     
        CType
    (e.TableView.Diagram.Schema.Connections("Connection").DbConnection, _
        System.Data.OleDb.OleDbConnection))    e.Command = Command
        e.Status = DataSetEventStatusEnum.Skip 1) e.Filter(0).ConditionTextDoesn’t work and gives me errors or doesn’t owrk at ALL.
    Yet if I use Debug.Print("DataLibrary StaffID Filter ........." & e.Filter(0).ConditionText)
    I get the correct value passed2)

    I cannot find a way to use multiple filters.
    example:
    “AND ( LinkID = e.Filter(???).ConditionText”

     In my Form that uses the dataset the code is:
      SideBarFormLinks.MdiParent = MainForm   
      
    SideBarFormLinks.Show()
      SideBarFormLinks.C1DataSet1.Fill(New C1.Data.FilterCondition(Nothing, Me.C1ListLinks.Columns(1).Text, True), False)

     How do I specify multiple Filters ?? 

    So how can I succesfully Filter my datasets on the fly ?

     

    God puit me on this earth to accomplish many tasks....
    Right now, I'm so far behind that I will never die!
Page 1 of 1 (1 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.