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 6117241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:17:53+00:00 2026-05-23T15:17:53+00:00

I am building a Payroll application in C# (learning C#) that will integrate into

  • 0

I am building a Payroll application in C# (learning C#) that will integrate into SAP Business 1.
When creating tables in SAP, SAP generates two fields automatically in user defined tables. One is Code – (primary key) and another is Name. Both are of type varchar/alphanumeric.

I have this query that returns the results although not in the fashion I want. I.e

Code    Name    U_Tax_year  U_Minimum_pay   U_Maximum_pay   
0        0        2011                 1         1  
1        1        2011                 2         2  
10      10        2011                11        11  
11      11        2011                12        12  
2        2        2011                 3         3  
3        3        2011                 4         4  
4        4        2011                 5         5  
5        5        2011                 6         6  
6        6        2011                 7         7  
7        7        2011                 8         8  
8        8        2011                 9         9  
9        9        2011                10        10  

This is due to the fact that Code and Name are not integer fields.

Below is my query:

// Get service instances
            var nhifTableSlabService = Program.Kernel.Get<INHIFTableSlabService>();

//Query database
            var nhiftableSlabs = from tb in nhifTableSlabService.GetAllNHIFTableSlabs()
                                where tb.U_Tax_year.ToString().Trim().Equals(cb_tax_year.Text.Trim(), StringComparison.CurrentCultureIgnoreCase)
                                orderby int.Parse(tb.Code.ToString()) descending
                                select tb;

            if (nhiftableSlabs.Any(x => x != null) 
            {
                // Enable datagridview
                dataGridView1.Visible = true;

                ...bla bla
            }

How do I get the results, convert the Codes to integers so that I can finally display the results in descending order of code?

  • 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-23T15:17:54+00:00Added an answer on May 23, 2026 at 3:17 pm

    Use Convert.ToInt32() instead of int.Parse and you are good to go. See here for more details.

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

Sidebar

Related Questions

Building an app with the Facebook JavaScript API that will embedded into a page
When building a report in Business Intelligence Studio 2008, I've noticed that the hide/show
Building a multilingual application that should work with the most prevalent global alphabets but
In building a content management system that incorporates jquery ajax into it's GUI I
Building a quick view that will display a list of all days but only
Building a client-side swing application what should be notified on a bus (application-wide message
building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
Building a new ASP.net application, and planning to separate DB, 'service' tier and Web/UI

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.