google-code-export / dataobjectsdotnet

Automatically exported from code.google.com/p/dataobjectsdotnet
0 stars 0 forks source link

SqlNullValueException while performing against empty database #864

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We upgraded to the beta version and since that I'm not able to create a SQL 
database. It does work for another developer that has a local database, but I'm 
not sure if that is the reason or not. Haven't been able to test it too much. I 
hope you are able to see what is wrong based on this stack trace:

[SqlNullValueException: Der Wert eines Null-SQL-Datensatzes kann nicht 
zurückgegeben werden.]
   System.Data.SqlClient.SqlBuffer.get_String() +5002963
   System.Data.SqlClient.SqlDataReader.GetString(Int32 i) +55
   Xtensive.Sql.SqlHelper.ReadDatabaseAndSchema(DbConnection connection, String queryText, CoreServerInfo coreServerInfo) +130
   Xtensive.Sql.SqlServer.DriverFactory.CreateDriver(String connectionString) +257
   Xtensive.Sql.SqlDriver.BuildDriver(ConnectionInfo connectionInfo) +125
   Xtensive.Sql.SqlDriver.Create(ConnectionInfo connectionInfo) +26
   Xtensive.Storage.Providers.Sql.Driver..ctor(Domain domain) +27
   Xtensive.Storage.Providers.Sql.DomainHandler.Initialize() +50
   Xtensive.Orm.Building.Builders.DomainBuilder.CreateHandlers() +148
   Xtensive.Orm.Building.Builders.DomainBuilder.BuildDomain(DomainConfiguration configuration, DomainBuilderConfiguration builderConfiguration) +246
   Xtensive.Orm.Upgrade.UpgradingDomainBuilder.BuildStageDomain(UpgradeStage stage) +296
   Xtensive.Orm.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration) +216
   Xtensive.Orm.Domain.Build(DomainConfiguration configuration) +5

Original issue reported on code.google.com by t...@faktum.co on 7 Jan 2011 at 9:13

GoogleCodeExporter commented 9 years ago
The error was because the user did not have any access to the SQL server. This 
query returned null since there was no current user:

select db_name(), default_schema_name from sys.database_principals where 
name=user

Original comment by t...@faktum.co on 3 Feb 2011 at 9:25