Questions

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

    Questions

    Hi,

    i) I've compiled a set of VB6 code into dll and add it (as a reference) into
    my C# program. When I clicked "Run", the program windows run pretty well.
    When I clicked the "Close" button of the windows, the program didn't stop
    fully, which made me have to click the "Stop" from the compiler. Can anyone
    help?

    ii) Is there anyway to sort a dataTable by ascending or descending?

    Please advice and thanks in advance.
    pcPirate


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Questions

    pcPirate,

    Without knowing what your code in VB is doing (or your .NET code), it is
    a little difficult. I would think that maybe there is a circular reference
    somewhere which isn't being cleaned up.

    To sort a datatable, you should create a new DataView class instance,
    attaching it to the DataTable. Once you do this, you can set the Sort
    property on the DataView, and access the rows through the DataView in the
    order as they would appear in the sort.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "pcPirate" <phoon_@hotmail .com> wrote in message
    news:%23BDfOPPn DHA.2488@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > Hi,
    >
    > i) I've compiled a set of VB6 code into dll and add it (as a reference)[/color]
    into[color=blue]
    > my C# program. When I clicked "Run", the program windows run pretty well.
    > When I clicked the "Close" button of the windows, the program didn't stop
    > fully, which made me have to click the "Stop" from the compiler. Can[/color]
    anyone[color=blue]
    > help?
    >
    > ii) Is there anyway to sort a dataTable by ascending or descending?
    >
    > Please advice and thanks in advance.
    > pcPirate
    >
    >[/color]


    Comment

    • pcPirate

      #3
      Re: Questions


      "pcPirate" <phoon_@hotmail .com> wrote in message
      news:eSnoq1bnDH A.1960@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Ok, my VB6 code contains a routine to access a tailored database via RDO.
      > I've compiled the VB6 code into *.dll and set it as a reference in my C#.
      > When I run my C# code, I would first have to access the tailored database
      > (in which, access the VB6's dll). And then, when I close the run program
      > from the C# compiler (MS VS.net), it doesn't stop fully.
      >
      > Pls advice and thanks in advance.
      > pcPirate
      >
      > "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> wrote[/color]
      in[color=blue]
      > message news:eUq6KsWnDH A.2068@TK2MSFTN GP09.phx.gbl...[color=green]
      > > pcPirate,
      > >
      > > Without knowing what your code in VB is doing (or your .NET code),[/color][/color]
      it[color=blue]
      > is[color=green]
      > > a little difficult. I would think that maybe there is a circular[/color]
      > reference[color=green]
      > > somewhere which isn't being cleaned up.
      > >
      > > To sort a datatable, you should create a new DataView class[/color][/color]
      instance,[color=blue][color=green]
      > > attaching it to the DataTable. Once you do this, you can set the Sort
      > > property on the DataView, and access the rows through the DataView in[/color][/color]
      the[color=blue][color=green]
      > > order as they would appear in the sort.
      > >
      > > Hope this helps.
      > >
      > >
      > > --
      > > - Nicholas Paldino [.NET/C# MVP]
      > > - mvp@spam.guard. caspershouse.co m
      > >
      > > "pcPirate" <phoon_@hotmail .com> wrote in message
      > > news:%23BDfOPPn DHA.2488@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
      > > > Hi,
      > > >
      > > > i) I've compiled a set of VB6 code into dll and add it (as a[/color][/color][/color]
      reference)[color=blue][color=green]
      > > into[color=darkred]
      > > > my C# program. When I clicked "Run", the program windows run pretty[/color][/color]
      > well.[color=green][color=darkred]
      > > > When I clicked the "Close" button of the windows, the program didn't[/color][/color]
      > stop[color=green][color=darkred]
      > > > fully, which made me have to click the "Stop" from the compiler. Can[/color]
      > > anyone[color=darkred]
      > > > help?
      > > >
      > > > ii) Is there anyway to sort a dataTable by ascending or descending?
      > > >
      > > > Please advice and thanks in advance.
      > > > pcPirate
      > > >
      > > >[/color]
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...