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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:00:51+00:00 2026-06-11T17:00:51+00:00

Am getting data from database and store in dataset.dataset contains list of phone numbers.

  • 0

Am getting data from database and store in dataset.dataset contains list of phone numbers.
i want to find out the length of each and every phone numbers. if it is length ten means add it in one datatable. Or length greater than 10 means get the 10 char from the right side of the phone number and stored it on the same datatable.Here is my code.when i debug the code i get only 8000 some thing rows.but originally the dataset contains 40,700 row values. after the
datatable reaches 8000 rows am getting error

my code
-------
  ada.Fill(ds, "reports.renewal_contact_t ")

                ds.Tables(0).DefaultView.RowFilter = " PHONE NOT like'0'"
                dt = ds.Tables(0)
                For Each q In dt.Rows
                    chkphone = q("PHONE").ToString
                    chkdphone = Regex.Replace(chkphone, "[^\d]", "")

                    'MessageBox.Show(chkdphone)


                    If (chkdphone.Length = 10) Then
                        Dim anyRow As DataRow = dt2.NewRow
                        anyRow(0) = chkphone.ToString
                        dt2.Rows.Add(anyRow)

                    ElseIf (chkdphone.Length >= 10) Then
                        rsltstring = chkdphone.Substring(chkdphone.Length, -10)

                        Dim anyrow1 As DataRow = dt2.NewRow
                        anyrow1(0) = rsltstring.ToString
                        dt2.Rows.Add(anyrow1)
                    Else


                    End If
                Next

                new_ds.Tables.Add(dt2)
                ComboBox1.DataSource = new_ds.Tables(0)
                ComboBox1.DisplayMember = "PHONE" 



 Error
 -----
 length cant be less than zero parameter name length
  • 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-11T17:00:53+00:00Added an answer on June 11, 2026 at 5:00 pm

    You can’t use a negative length in the Substring method. Subtract ten from the length to get the starting point of the string that you want:

    rsltstring = chkdphone.Substring(chkdphone.Length - 10, 10)
    

    As you want the rest of the string from that point, the second parameter is actually not needed:

    rsltstring = chkdphone.Substring(chkdphone.Length - 10)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two methods for getting data from my database: - (void)
I am getting some data from my database table. The query I use is
I have an issue. I am getting data from a MySQL database, and make
How to retrieve data from sqlite database? Getting return value zero. -(id)init{ if(self==[super init]){
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
I retrieve few data from database then store it into hashmap and display it
This solution has evaded me all day. I am getting data from my database,
I am getting a set of data from the database where the query produces
Im getting data from a server by executing this code: - (void) sendGeneral:(NSString *)
how can i getting data from listbox in second form named listform while i

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.