Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5971449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:31:04+00:00 2026-05-22T20:31:04+00:00

What is the difference between test.Rows[0] and test.Rows[test.Rows.Count – 1] if rows is a

  • 0

What is the difference between test.Rows[0] and test.Rows[test.Rows.Count - 1] if rows is a collection in a datatable.For example
if count =o or count = -1 what will be the situation here

My intention was to determine the last value in that collection.If no value is there in that collection will it make problems
Previously test.Rows[0][“Level”] is always giving 18 digit number but when i made in to test.Rows[test.Rows.Count – 1][“version”] it is giving correct one

SO finally my question is if count = 1 will both statement test.Rows[0] and test.Rows[test.Rows.Count – 1] will be equal or what is the situation will both statement are equal
I debugged code ,if i go with test.Rows[0][“Level”] it always showing one 18 digit constant value,why it is showing like that.This Test is a datatable in .xsd file where i can see one and only ‘Level’ row

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:31:04+00:00Added an answer on May 22, 2026 at 8:31 pm

    In a zero-based collection / array / list, etc; item 0 and item count - 1 are the first and last items respectively.

    For example if count =o

    If the collection does not have any items, either of the above will usually result in an out-of-range exception. So… don’t do that. Check the size first.

    or count = -1

    If the count is -1, you have bigger problems – like, you broke the universe

    You might also look at LINQ’s FirstOrDefault() / LastOrDefault() etc (both have special checking for typed lists to minimise pain – but I don’t know if .Rows is technically a typed list (IList<T>) – I suspect not); but access via an indexer is convenient and fast.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a difference between move and forward here: void test(int && val) {
whats the difference between executing script like # ./test and # . ./test test
I am trying to test the difference between no,even and odd parity - always
I was trying to test the performance difference between inserting into a table directly
What is the difference between test -L filename and test -h filename in ksh
What is the difference between: t.boolean :test, :default => true and t.boolean :test, :null
What's the difference between (fictious): public Test GetTest() { Object obj = new Test();
I want to simply know the basic difference between failed test and broken test
What is the difference between a Theory and a Parameterized test? I'm not interested
I'm wondering what's the difference between this code: var c = [{test: 1}]; and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.