how can I deal with dataview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tianxz
    New Member
    • Apr 2009
    • 1

    how can I deal with dataview

    In my project. I have two DataTables: DTA,DTB.
    I try do:
    Dataview view=new dataview(DTA);
    datagridview1.d atasoruce=view;
    view=new dataview(DTB);
    datagridview2.d atasource=view.

    I found both datagridview1 and datagridview2 are working. the datagirdview1 still display the data in DTA and datagridview2 display the datat in DTB.
    I think after I set view=new dataview(DTB), the dataview still exists that created by Dataview view=new dataview(DTA); how could I release this dataview when I don't need it? thank you.

    Otherwise DTA will have many dataview when I load the page many times.
  • modolamara
    New Member
    • Apr 2009
    • 3

    #2
    from my understanding of it, the view variable refers to one object at a time when you assign it to the new object (new Dataview(DTB)) its no longer referring to the first object

    Comment

    • ram09
      New Member
      • Oct 2008
      • 45

      #3
      you can insert this:
      view.Table.Clea r();

      before you insert a new data table into your view.. this will clear all the datatables inside your dataview...

      Comment

      Working...