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

  • Home
  • SEARCH
  • 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 8076529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:16:43+00:00 2026-06-05T15:16:43+00:00

i try to read Data from an Oracle-Database. The problem is that in some

  • 0

i try to read Data from an Oracle-Database.
The problem is that in some cases the receiving data adds Zeros after the digit and i dont know why this happens?!?

For example i want to read Data like this

1

1,1

1,12

1,123

When i read it with Oracle-Datareader i get

1

1,10 <-

1,12

1,1230 <-

Everytime the decimal places are 1,3,5,7 long it adds one 0 in the result.
But why is this happening??
Does anyone know this kind of problem?

EDIT:

Dim cmd As OracleCommand = New OracleCommand(Select_Statement, Connection)

Dim dr As OracleDataReader

dr = cmd.ExecuteReader


While dr.Read()

            If dr("C1").ToString = V1 Then

                Me.Txt_1.Text = dr.GetDecimal(3).ToString("G0")

                Me.Txt_2.Text = dr(c4)

                Me.Txt_3.Text = dr(c5)

                Me.Txt_4.Text = dr(c6)


            End If

            If dr("C2").ToString = V2 Then

                Me.Txt_5.Text = dr(c3)

                Me.Txt_6.Text = dr(c4)

                Me.Txt_7.Text = dr(c5)

                Me.Txt_8.Text = dr(c6)


            End If

        End While

dr.Close()

This is the way i read the data from the database, if there is a better way i would be happy about some tips! Because the way with dr.GetDecimal() only excepts numbers for row indexing.

  • 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-06-05T15:16:44+00:00Added an answer on June 5, 2026 at 3:16 pm

    It’s in the C# and not in the DB.

    From the Documentation:

    If format is null or an empty string, the return value of this
    instance is formatted with the general numeric format specifier (G)

    The general format contain the zero you want to avoid.
    If you want to remove it, just do:

    string sd = dr.GetDecimal(0).ToString("G0");
    

    Where dr is my OracleDataReader

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

Sidebar

Related Questions

I have some SerialPort code that constantly needs to read data from a serial
I retrieve data from Oracle database and populate a gridview. Next, I try to
I try to wrote code that read data from stdin: size_t bufSize = 1024;
I'm trying to read data from a socket, however whenever I try to read
In the following code, I try to read data from a plist: -(void)readPreferences {
I see that when I try to read the value from a textarea field
How can I try to read data from socket with timeout? I know, select,
Scenario: I have an application that pulls data from a SQL database as well
I need to read data from socket byte by byte. I try to do
I try to read and write data from/to Socket with NSStream. Here is my

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.