locked
Input string was not in a correct format RRS feed

  • Question

  • Hello everyone,

    i tried to to poll data from sql server using service inbound typed polling , im getting the below error when i start the application in biztalk server,

    System.FormatException: Input string was not in a correct format.

    can anyone let me know about this ..

    thanks


    panadi

    Monday, October 17, 2016 1:38 PM

Answers


  • The solution looks pretty clear as stated. You may need to import the bindings that were created via Add Generated Items and check the binding properties with the screenshot you have shared. Either one of the properties is a mismatch

    Another thing, are the values for PollingDataAvailableStatement & PollingStatement , the same ?

    Also to add, please check the datatype format  of the schema consumed for Datetime field and see if it matches the format for the field in Stored proc. .Hope this helps !


    Tuesday, October 25, 2016 7:52 AM

All replies

  • This error is thrown when a Type is trying to parse what is otherwise a string value, such as what appears in Xml.

    The most common source of this is DateTime conversion.

    Can you share the entire error stack?  We can probably help you with where to look.

    Monday, October 17, 2016 2:05 PM
    Moderator
  • The adapter "WCF-Custom" raised an error message. Details "Microsoft.ServiceModel.Channels.Common.AdapterException: Input string was not in a correct format.. Endpoint Address - mssql://ServerName//DbName?InboundId=GetFileNames ---> System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
       at System.String.System.IConvertible.ToInt64(IFormatProvider provider)
       at System.Convert.ToInt64(Object value, IFormatProvider provider)
       at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.Polling_WaitForMessage(TimeoutHelper timeoutHelper)
       at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.WaitForMessage(TimeSpan timeout)
       --- End of inner exception stack trace ---
       at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.WaitForMessage(TimeSpan timeout)
       at Microsoft.ServiceModel.Channels.Common.Channels.AdapterInputChannel.WaitForMessage(TimeSpan timeout)
       at System.ServiceModel.Dispatcher.InputChannelBinder.WaitForMessage(TimeSpan timeout)
       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.WaitForMessage()".

    panadi

    Monday, October 17, 2016 2:13 PM
  • Hi Panadi,

    Your connection string should look something like below.

    mssql://<server_name>/<database_instance_name>/<datbase_name>?InboundID=Employee
    Regards,


    Mandar Dharmadhikari

    Monday, October 17, 2016 3:04 PM
    Moderator
  • Hi Mandar,

    Database instance name is empty , And i was followed the same procedure, correct me if i am wrong.

    thanks


    panadi

    Monday, October 17, 2016 3:08 PM
  • Sure it seems to be correct in that scenario.

    How are you polling the data can you share the polling statement???

    Regards,


    Mandar Dharmadhikari

    Monday, October 17, 2016 3:14 PM
    Moderator
  • It's unusual this is happening at this point since everything around this is auto generated.

    It looks like a fields that supposed to be a Int is being emitted with something else, could be just a non-Integer number.

    System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
       at System.String.System.IConvertible.ToInt64(IFormatProvider provider)

    Monday, October 17, 2016 3:54 PM
    Moderator
  • How are you polling the data can you share the polling statement???

    Hi Mandar,

    I am doing service(Inbound Operation) using typed polling with stored procedure.

    below is the polling statement.

    exec [dbo].[StoredProcName]

    Thanks


    panadi

    Tuesday, October 18, 2016 10:47 AM
  • Hi panadi,

    Share the stored proc details if possible..because it just doesnt make any sense that adapter should throw errror as your setting seems to be perfect...

    Regards,


    Mandar Dharmadhikari

    Tuesday, October 18, 2016 12:10 PM
    Moderator
  • Hi Mandar, Below is my SP . Please let me know what is wrong in it!.

    SP Hidden


    panadi



    • Edited by panadi Wednesday, October 26, 2016 1:59 PM
    Friday, October 21, 2016 6:50 AM
  • Hi panadi,

    The SQL stored proc looks good on the first glance...please share the screen shot for the properties that you have configured on the Receive location to poll the data ...may be there is something missing there..

    Regards,


    Mandar Dharmadhikari

    Friday, October 21, 2016 7:09 AM
    Moderator
  • Hi Mandar,

    Please see the below properties and let me know the changes if required.

    Properties hidden

    Thanks

    panadi





    • Edited by panadi Wednesday, October 26, 2016 2:00 PM
    Friday, October 21, 2016 7:25 AM
  • Hi panadi,

    Looks like you are using the same sp to check the polling available data check, it must return an integer value in the first column of the result ...may be this seems to be the trouble..

    Refer screen shot below

    Have you manually created this port or you imported the bindings created by the Add Generated items Wizard???

    Regards,


    Mandar Dharmadhikari



    Friday, October 21, 2016 11:48 AM
    Moderator

  • The solution looks pretty clear as stated. You may need to import the bindings that were created via Add Generated Items and check the binding properties with the screenshot you have shared. Either one of the properties is a mismatch

    Another thing, are the values for PollingDataAvailableStatement & PollingStatement , the same ?

    Also to add, please check the datatype format  of the schema consumed for Datetime field and see if it matches the format for the field in Stored proc. .Hope this helps !


    Tuesday, October 25, 2016 7:52 AM
  • Thank you all for your valuable suggestions, Have done few changes in sp and imported the binding file that is created via Add generated items resolves this issue.

    Once again thank you all.:):)


    panadi


    • Edited by panadi Wednesday, October 26, 2016 2:00 PM
    Wednesday, October 26, 2016 1:57 PM
  • Hi Panadi,

    I would request you to mark the related reply as answer which has helped you.


    Regards


    Mandar Dharmadhikari

    Wednesday, October 26, 2016 4:18 PM
    Moderator
  • Thank you all for your valuable suggestions, Have done few changes in sp and imported the binding file that is created via Add generated items resolves this issue.

    Once again thank you all.:):)


    panadi


    Hi Panadi.

    Could you please mark the reply you consider answered your question as the ANSWER to close this thread?

    Thank you,



    My Technet Articles

    If you like this or another reply, vote it up!
    If you think this or another reply answers the original question, mark it or propose it as an answer.


    Mauricio Feijo
    www.mauriciofeijo.com

    Wednesday, October 26, 2016 4:47 PM