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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:37:44+00:00 2026-05-26T08:37:44+00:00

I have the below code in my app… Nothing is declared as a integer

  • 0

I have the below code in my app… Nothing is declared as a integer so I dont understand or see where the problem could be… It is saying:

Conversion from string “9838 Co Rd 47” to type ‘Integer’ is not valid.

The address is flowing through the entire function as a string the only place I think it could be getting changed somehow is in a function call… Below is the function that throws the exception. Followed by the function that returns the address… The error comes from the
_holder = item.bill_to.remove(address) line

  For Each item In _QuickImport
            Dim BusinessName As String = Nothing
            Dim CustomerName As String = " "
            _Id = item.id
            If Not String.IsNullOrEmpty(item.Customer) Then
                Dim _holder As String = String.Empty
                Dim _contact_ As String = item.Contact
                Dim _address_ As String = String.Empty

                If item.Bill_to.Contains(_contact_) Then
                    _holder = item.Bill_to.Replace(_contact_, " ")
                End If
                If Not String.IsNullOrEmpty(_holder) Then
                    If item.Bill_to.Contains("Co Rd") Then
                        _address_ = ExtractAddressWithCoRd(_holder)
                    End If
                Else
                    If item.Bill_to.Contains("Co Rd") Then
                        _address_ = ExtractAddressWithCoRd(item.Bill_to)
                    End If
                End If

                If Not String.IsNullOrWhiteSpace(item.Customer) Then
                    If item.Customer.Contains(":") Then
                        BusinessName = item.Customer.Split(":")(0)
                        CustomerName = item.Customer.Split(":")(1)
                    Else
                        CustomerName = item.Customer
                    End If
                End If


                If Not String.IsNullOrEmpty(BusinessName) Then
                    If item.Bill_to.Contains(BusinessName) Then
                        _holder = item.Bill_to.Replace(BusinessName, " ")
                    End If
                End If



                Dim _Id_ As Integer = _Id

                If Not String.IsNullOrWhiteSpace(_holder) Then
                    Dim _check As Boolean = True
                    _check = ValidZip(_holder)
                    If _check = True Then
                        If Not String.IsNullOrEmpty(_address_) Then
                            _holder = Convert.ToString(_holder)
                            _address_ = Convert.ToString(_address_)
                            _holder = item.Bill_to.Remove(_address_)
                        End If
                        parseAddress(_holder, _Id)

The other function is:

    Private Function ExtractAddressWithCoRd(ByVal input As String) As String
        Dim add1 As String = String.Empty
        Dim add2 As String = String.Empty
        Dim parts() As String = input.Split(" "c)
        For i As Integer = 0 To parts.Length - 1
            If parts(i) = "Co" AndAlso i > 0 Then
                add1 = parts(i - 1)
            ElseIf parts(i) = "Rd" AndAlso i < parts.Length - 1 Then
                add2 = parts(i + 1)
            End If
        Next

        Return add1 + " Co Rd " + add2
    End Function

This is where I think something is getting changed to a integer value… but this is all declared as string as well…

Any ideas????

  • 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-26T08:37:45+00:00Added an answer on May 26, 2026 at 8:37 am

    This is where I think something is getting changed to a integer
    value…

    No, that’s not it. Read the error message again:

    Conversion from string “9838 Co Rd 47” to type ‘Integer’ is not valid.

    “Conversion from string” means that your _address_ variable really IS a string, and it’s value is even displayed (“9838 Co Rd 47”).

    It tries to convert this string to an integer because item.Bill_to is a String and String.Remove expects an integer argument (the position from which to remove characters), but you pass a string instead. What you’re looking for is String.Replace, which you already use elsewhere:

    _holder = item.Bill_to.Replace(_address_, "")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with the splitviewcontroller. I have the code below and when
I have the below code in a .Net 4 Winforms app which loads an
I have below code in html. <li class=selected runat=server id=lihome><a href=/ISS/home.aspx title=Home><span>Home</span></a></li> Now I
I have below code behind in c# if (Session[cmpDictionaryTitle]!= null) { downloadLinks.Text += @<li><a
I have below code to insert a style into DOM (there is a use
I have below html code in my aspx. <input type=hidden id=medicalLink value='<a href=/forms/contactus.aspx >Contact
I have below XAML code : <Window x:Class=WpfApplication1.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml DataContext={Binding RelativeSource={RelativeSource Self}} WindowStartupLocation=CenterScreen
I have the below code in stdafx.h. using namespace std; typedef struct { DWORD
I have the below code, which iterates over a list based on a custom
I have the below code for my a Dialog box for a which contains

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.