Exception: "Input string was not in a correct format."

rdugrerdugre Posts: 13
edited February 7, 2006 8:53AM in SQL Packager Previous Versions
I am receiving the following exception (w/ stack trace below):

"Input string was not in a correct format."
Server stack trace:     at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)    at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider)    at System.Int32.Parse(String s)    at System.Convert.ToInt32(String value)    at Package.SQLPackage_TC500_Upgrade_453.SQLBatches..ctor() in C:\\Projects\\Testcraft Projects\\Database Package\\Projects\\SQLPackage_TC500_Upgrade_453\\SQLPackage_TC500_Upgrade_453\\PackageResourceManager.cs:line 122    at Package.SQLPackage_TC500_Upgrade_453.PackageResourceManager.GetSQLBatches() in C:\\Projects\\Testcraft Projects\\Database Package\\Projects\\SQLPackage_TC500_Upgrade_453\\SQLPackage_TC500_Upgrade_453\\PackageResourceManager.cs:line 76    at Package.SQLPackage_TC500_Upgrade_453.PackageExecutor.Execute() in C:\\Projects\\Testcraft Projects\\Database Package\\Projects\\SQLPackage_TC500_Upgrade_453\\SQLPackage_TC500_Upgrade_453\\PackageExecutor.cs:line 327    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)    at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)  Exception rethrown at [0]:     at Package.SQLPackage_TC500_Upgrade_453.ProgressDialog.Run(IProgressExecutor executor) in c:\\projects\\testcraft projects\\database package\\projects\\sqlpackage_tc500_upgrade_453\\sqlpackage_tc500_upgrade_453\\progressdialog.cs:line 550    at Package.SQLPackage_TC500_Upgrade_453.PackageMain.Main(String[] args) in c:\\projects\\testcraft projects\\database package\\projects\\sqlpackage_tc500_upgrade_453\\sqlpackage_tc500_upgrade_453\\packagemain.cs:line 116

This happens when I run the package executable and after I click the [Run] button once I've selected a database to upgrade. Any idea what could be causing that?
-- Rob --


  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Rob,

    Is there any chance you'd edited one of the resources in the c# project? There is probably something in the resources that contains the batch count. If that becomes something that can't be converted into a number, that may be the reason for the error message!
  • Well, I debugged the code some more and found the following:

    The code is looking for an entry in the resource file named "PACKAGE_BATCH_COUNT", but the actual name for that entry in the resource file is "BatchCount"... so I think that is the source of the problem.

    Incidentally, I didn't run into this issue with a New Database Package, its only happening on an Update Database Package.
    -- Rob --
  • Ohh, and I did not modify the resource file at all.
    -- Rob --
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Package Resource Manager is supposed to get a value out of the package called "PACKAGE_BATCH_COUNT". Everything in the package resources is stored as text, but it needs to be resolved to an integer.

    Can you please send us the c# project so we can try to figure out why it isn't working?

    The email address is [email protected].

  • Please disregard this post. I recreated the package code and everything seems to be working as expected now. I think it had something to do with the assembly name not being in sync with the package name, but that is just a guess.
    -- Rob --
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    I think that there is still an issue about changing the namespace in the package. As far as I know it's safe to rename the package's file name. It may not be safe to rename any of the files, however, if the package contains an executable and several dll files, say, if the package's script resources go over the 100MB limit that causes dll files to be created alongside the main executable.
Sign In or Register to comment.