none
Problems with querying SAP - Input string was not in a correct format error RRS feed

  • Question

  • I am trying to do a simple test query to import data from SAP: SELECT * FROM kna1

    I have tried using the Import Data Wizard in SQL Management Studio and when trying to parse the query I get the following error:

    The type initializer for 'Microsoft.Adapters.SAP.SAPPerfCounters' threw an exception (Microsoft.Adapters.SAP.SAPGInvoker).  Input string was not in a correct format (mscorlib)

    Anyone any ideas?  I have tried uninstall and re-installing .Net Framework 3, the WCF LOB adapter and the BizTalk adapter to no avail.

    Thursday, January 22, 2009 4:26 PM

Answers

All replies

  • That is a very strange error. Can you try this: uninstall the Adapter Pack and the WCF LOB Adapter SDK. Install the Dec CTP of the LOB Adapter SDK and the Adapter Pack V2 from the link given here: "http://blogs.msdn.com/adapters/archive/2008/12/15/biztalk-adapter-pack-v2-ctp.aspx". Does that help, or is the problem yet there?
    Thursday, January 22, 2009 6:22 PM
  •  Hi, I did as suggested.  This time I got a similar error during the installation of the BizTalk Adapter.  This is the contents of the adaptersetup log file:

    ***************Start***************
    System.Diagnostics.Process (CustomAction) 01/23/2009 10:50:45
    CustomActionMachineDOTConfig called. args[0]=-i ; args[1]=sql ; args[2]=5 ; args[3]=31bf3856ad364e35
    IsBtsInstall =
    IsInstall = True
    UILevel = 5
    Adding Binding Extension for : sqlBinding
    Added Binding Extension for : sqlBinding
    Adding Binding Element Extension for : SqlAdapter
    Added Binding Element Extension for : SqlAdapter
    Adding Behavior Extension for : sqlAdapterInboundTransactionBehavior
    Added Behavior Extension for : sqlAdapterInboundTransactionBehavior
    Adding IMetadataExchange endpoint for : sqlBinding
    Added IMetadataExchange endpoint for : sqlBinding
    Adding performance Counters for category:BizTalk .NET Adapter for SQL Installing/Delete:True
    An error occurred while installing the performance counter category BizTalk .NET Adapter for SQL. Exception Message : Input string was not in a correct format.. Exception Stack Trace :    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int32.Parse(String s, IFormatProvider provider)
       at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
       at System.Diagnostics.PerformanceCounterLib.get_NameTable()
       at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
       at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)
       at Microsoft.Adapters.Setup.CustomAction.Program.CreatePerformanceCounters(String perfCategory, String perfCategoryHelp, PerfCounterHelper[] perfCounters, Boolean create)
       at Microsoft.Adapters.Setup.CustomAction.Program.Main(String[] args).
    ***************End*****************
    ***************Start***************
    System.Diagnostics.Process (CustomAction) 01/23/2009 10:53:37
    CustomActionMachineDOTConfig called. args[0]=-i ; args[1]=sap ; args[2]=5 ; args[3]=31bf3856ad364e35
    IsBtsInstall =
    IsInstall = True
    UILevel = 5
    Adding Binding Extension for : sapBinding
    Added Binding Extension for : sapBinding
    Adding Binding Element Extension for : sapAdapter
    Added Binding Element Extension for : sapAdapter
    Adding IMetadataExchange endpoint for : sapBinding
    Added IMetadataExchange endpoint for : sapBinding
    Adding performance Counters for category:BizTalk .NET Adapter for SAP Installing/Delete:True
    An error occurred while installing the performance counter category BizTalk .NET Adapter for SAP. Exception Message : Input string was not in a correct format.. Exception Stack Trace :    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int32.Parse(String s, IFormatProvider provider)
       at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
       at System.Diagnostics.PerformanceCounterLib.get_NameTable()
       at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
       at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)
       at Microsoft.Adapters.Setup.CustomAction.Program.CreatePerformanceCounters(String perfCategory, String perfCategoryHelp, PerfCounterHelper[] perfCounters, Boolean create)

    The installation finished and on trying the select in SQL Management Studio I got the same error as before. 

    Friday, January 23, 2009 11:13 AM
  • Ok, uninstall the Adapter Pack and the ASDK, again.

    Then, according to this post: "http://www.bokebb.com/dev/english/1993/posts/199395546.shtml", a user has mentioned that running "lodctr /R" from the command prompt helped.

    After that, can you re-install the ASDK + Adapters and see if things work? Delete the AdapterSetup.log file before installing.

    • Marked as answer by R3i Monday, January 26, 2009 1:26 PM
    Monday, January 26, 2009 1:05 AM
  • Rebuilding the performance counter library values was the answer.

    Many thanks for your help.

    Monday, January 26, 2009 1:27 PM