Results 1 to 2 of 2

Thread: Upgrading to VB.NET, 2 questions (reading files, tables)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    9

    Upgrading to VB.NET, 2 questions (reading files, tables)

    I've recently upgraded an application from VB6 to VB.NET, and am in the process of fixing the issues that have cropped up as a result. Two main questions I have here, any help would be appreciated.

    1. This code snippet in VB6:

    Code:
    Open d$ For Random Shared As f Len = 256
           Get f, 1, X
           If X > 0 Then Get f, X + 1, aldata
    Close f
    translates (according to the upgrade wizard) to:

    Code:
    FileOpen(f, d, OpenMode.Random, , OpenShare.Shared, 256)
    FileGet(f, X, 1)
    If X > 0 Then FileGet(f, aldata, X)
    FileClose(f)
    but this returns a completely different array of values for aldata. I know that d (the filename) and X (the index) are the same in both cases, but the data produced is very dis-similar.

    Aldata is a defined structure:

    Code:
    Structure Allocations
         <VBFixedArray(6, 10)> Dim Asset(,) As Integer        
    End Structure
    The numbers are clearly similar, but I can't find a steady correlation between their positions, and it doesn't make sense that they are different at all. Also, there is an 8 (9th column) in the VB6 array that does not appear at all in the VB.NET array.

    VB.NET

    Code:
    0    0    0    0    0    0    0    0    2    0
    0    0    0    0    0    0    0    38   0    0
    0    0    0    0    0    0    0    0    21.5 0
    0    0    0    0    0    0    0    0    9    0
    0    0    0    0    0    0    0    0    21.5 0
    0    0    0    0    0    0    0    0    0    0


    VB6

    Code:
    2    0    0    0    0    0    0    0    0    0
    0    0    0    0    0    0    0    0    0    0
    21.5 0    0    0    0    0    0    0    8    0
    9    0    0    0    0    0    0    0    0    0
    21.5 0    0    0    0    0    0    0    38   0
    0    0    0    0    0    0    0    0    0    0

    I need to know what has changed that makes this file access different.

    If you need more information, please ask, I am pretty desperate to get this sorted out


    2. Much shorter and easier question: The application used several tables in VB6, which have translated to AxMSFlexGrid tables in VB.NET. These tables are not editable, and appear to have no flag to enable editing. Is there an equivalent table I can use that has editing capability without having to use any database add-ins?

    Any ideas about any of this would be much appreciated.

    Thanks for any help,

    Vulpes

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    For the array issue , It looks like sorting glitch . You might try the .Reverse() method of the array .

    For the 2nd question , DataGrid seems to be what you are looking for in .NET .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width