getting table from currencymanger

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • astro

    #1

    getting table from currencymanger


    Is there a way I can get the table for which a given currencymanager is
    pointed to?

    I am thinking of a routine that take a currencymanager as an arguement,
    figures out which table it represents and issues an update for the
    appropriate data adapter.

    Thanks


  • Cor Ligthert [MVP]

    #2
    Re: getting table from currencymanger

    Astro,

    Probably using this.

    http://msdn.microsoft.com/library/de...dingstopic.asp

    I hope this helps,

    Cor


    Comment

    • Bart Mermuys

      #3
      Re: getting table from currencymanger

      Hi,

      "astro" <astro@mnrr.com > wrote in message
      news:ZRWHe.3319 $Zh.2154@tornad o.rdc-kc.rr.com...[color=blue]
      >
      > Is there a way I can get the table for which a given currencymanager is
      > pointed to?[/color]

      Even when you bind to a DataTable or DataSet internally a DataView is used
      by the CurrencyManager , so to get the Table, you first get the view :

      Public Function GetTable(ByVal cm As CurrencyManager ) As DataTable

      Dim view As DataView = DirectCast(cm.L ist, DataView)
      Return view.Table

      End Function

      Hth,
      Greetings

      [color=blue]
      >
      > I am thinking of a routine that take a currencymanager as an arguement,
      > figures out which table it represents and issues an update for the
      > appropriate data adapter.
      >
      > Thanks
      >
      >[/color]


      Comment

      • astro

        #4
        Re: getting table from currencymanger

        thanks - that works )

        is there a way to get the dataAdapter from the the currencyManager ?

        otherwise I code the 'select case.........'


        "Bart Mermuys" <bmermuys.nospa m@hotmail.com> wrote in message
        news:uA2qPgDmFH A.1464@TK2MSFTN GP14.phx.gbl...[color=blue]
        > Hi,
        >
        > "astro" <astro@mnrr.com > wrote in message
        > news:ZRWHe.3319 $Zh.2154@tornad o.rdc-kc.rr.com...[color=green]
        >>
        >> Is there a way I can get the table for which a given currencymanager is
        >> pointed to?[/color]
        >
        > Even when you bind to a DataTable or DataSet internally a DataView is used
        > by the CurrencyManager , so to get the Table, you first get the view :
        >
        > Public Function GetTable(ByVal cm As CurrencyManager ) As DataTable
        >
        > Dim view As DataView = DirectCast(cm.L ist, DataView)
        > Return view.Table
        >
        > End Function
        >
        > Hth,
        > Greetings
        >
        >[color=green]
        >>
        >> I am thinking of a routine that take a currencymanager as an arguement,
        >> figures out which table it represents and issues an update for the
        >> appropriate data adapter.
        >>
        >> Thanks
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Bart Mermuys

          #5
          Re: getting table from currencymanger

          Hi,

          "astro" <astro@mnrr.com > wrote in message
          news:F%pIe.610$ 32.371@tornado. rdc-kc.rr.com...[color=blue]
          > thanks - that works )
          >
          > is there a way to get the dataAdapter from the the currencyManager ?[/color]

          No, a DataAdapter is not associated with a CurrencyManager .

          A Select...Case would do it, an alternative is to use a Hashtable for
          associating each DataTable with a CurrencyManager .

          Hth,
          Greetings


          [color=blue]
          >
          > otherwise I code the 'select case.........'
          >
          >
          > "Bart Mermuys" <bmermuys.nospa m@hotmail.com> wrote in message
          > news:uA2qPgDmFH A.1464@TK2MSFTN GP14.phx.gbl...[color=green]
          >> Hi,
          >>
          >> "astro" <astro@mnrr.com > wrote in message
          >> news:ZRWHe.3319 $Zh.2154@tornad o.rdc-kc.rr.com...[color=darkred]
          >>>
          >>> Is there a way I can get the table for which a given currencymanager is
          >>> pointed to?[/color]
          >>
          >> Even when you bind to a DataTable or DataSet internally a DataView is
          >> used by the CurrencyManager , so to get the Table, you first get the view
          >> :
          >>
          >> Public Function GetTable(ByVal cm As CurrencyManager ) As DataTable
          >>
          >> Dim view As DataView = DirectCast(cm.L ist, DataView)
          >> Return view.Table
          >>
          >> End Function
          >>
          >> Hth,
          >> Greetings
          >>
          >>[color=darkred]
          >>>
          >>> I am thinking of a routine that take a currencymanager as an arguement,
          >>> figures out which table it represents and issues an update for the
          >>> appropriate data adapter.
          >>>
          >>> Thanks
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]



          Comment

          Working...