This project is read-only.

NewDatabaseName value missing while creating a database with nHydrate installer and commandline parameters

Jan 22, 2013 at 5:01 PM


I´m trying to create a database with my generated nHydrate installer using commandline parameters.

During the installation process an error occurs.

I think the problem is in the generated code.

With the debugger i´ve noticed that the instance of "InstallSetup" has no value for "NewDatabaseName".

I´ve noticed that the method "GetDbName" in the "DatabaseInstaller" class is never used and so the value "NewDatabaseName" is never set. That´s why the method "CreateDatabase" in the "SqlServers" class throws an exception while trying to create a database.

Is this a known issue?

Is there a workaround i could use?

Maybe it´s my mistake?

My nHydrate Version:


Jan 23, 2013 at 2:16 AM

The command line functionality has been improved. Look for this in the next version. A command line like these will work in the next version.

-console /create /ConnectionString:"server=.;initial catalog=MyTest;integrated security=sspi;" /master:"server=.;initial catalog=master;integrated security=sspi;" /newdb:MyTest

-console /upgrade /ConnectionString:"server=.;initial catalog=MyTest;integrated security=sspi;"

May 8, 2013 at 4:50 PM

I have a just created empty database with special permissions but without tables or other content. I want to upgrade this database with the upgrade command from the previous post (written by codetools at 2013/01/23), but I get an SQL Exception while running InstallUtil:

Cannot find the object "dbo.TableName" because it does not exist or you do not have permissions.

This message is correct, because the database is empty. So the '/upgrade'-command doesn't work. But I can't call the '/create'-command, because the database already exists and the following exception will be thrown:

System.Exception: The connection string references an existing database.

How can I upgrade an existing empty database with the InstallUtil parameters?