CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Rowerror

  1. #1
    Join Date
    Oct 2002
    Location
    Australia
    Posts
    207

    Rowerror

    If I use a DataTable
    DataGrid1.DataSource = DataSet1.Tables(0)
    it displays all rows and column from the table.

    If I use a DataRowArray
    DataGrid1.DataSource = DataSet1.Tables(0).Select()
    it displays only 2 colums RowError and HasErrors
    the rowcount is the rowcount from the table but RowError is in all rows
    blank and HasErrors is in all rows "False"

    Why does it not display the same output?


    Thanks

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Rowerror

    So, maybe I'm completely wrong and "Tables" is a method (never worked with either of those classes), but if Tables is a collection than that is VB code, and VB is 1 indexed, not 0.

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Rowerror

    Vb is not 1 indexed. At least not as a rule. It can be however.

    As to the problem in the OP doesn't Select() require a parameter of some sort?

    http://msdn.microsoft.com/en-us/libr...zc(VS.80).aspx
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Rowerror

    Geez, you're right:

    The range of the array index can be 0 to 10 or 1 to 10, depending on the default value indicated with the Option Base statement.
    What a stupid language...

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Rowerror

    Vb coders may say the same about C#
    Always use [code][/code] tags when posting code.

  6. #6
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Rowerror

    Quote Originally Posted by DataMiser View Post
    Vb coders may say the same about C#
    Maybe, but they would be wrong. It's not really a subjective thing, VB is just a poorly designed language from top to bottom, but I'll stop ranting now :P

  7. #7

    Re: Rowerror

    I agree VB on the surface seems pretty darn stupid.

    I have learned that it is far easier to program VB on a non-US keyboard where the { and the ; are not inheritantly on the keyboard. I got so tired of typing Alt + plus whatever the stupid character code was that after two weeks I was ready to convert. Thank god I got to come home.

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

Featured