views:

803

answers:

1

In the last two days I refactored a lot of Stored Procedures. Today I ran SubSonic and tried the application and I get this error that's driving me crazy:

Could not locate entry in sysdatabases for database 'sp'. No entry found with that name. Make sure that the name is entered correctly. :    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

   at SubSonic.SqlDataProvider.GetDataSet[T](QueryCommand qry)

   at SubSonic.DataService.GetDataSet[T](QueryCommand cmd)

   at SubSonic.StoredProcedure.GetDataSet[T]()

   at SubSonic.StoredProcedure.GetDataSet()

   at Edu3.Business.MetaDataLogic.LoadAllLibraries() in C:\Users\LIC.TELEVIC\_PROJECTS\_TELEVIC\Edumatic3\edumatic-3-framework-server-.NET\Edumatic3.Business\MetaDataLogic.cs:line 68

   at Edu3.Service.MetaDataService.LoadAllLibraries() in C:\Users\LIC.TELEVIC\_PROJECTS\_TELEVIC\Edumatic3\edumatic-3-framework-server-.NET\Edumatic3.Services\MetaDataService.cs:line 34

Any help would be welcome. Seems the problem is only to do with Stored Procedures.

The are named like ALTER PROCEDURE [dbo].[sp.Edu3.CopyBlock] ALTER PROCEDURE [dbo].[sp.Edu3.CopyComponent]

I have omitted the points in the name, but that doesn't solve it...

For the rest, nothing has changed since before when things worked...

Thx

A: 

Apparently the points in the Stored Procedure name were the problem... Has anybody got an idea why this is a problem in SubSonic?

In SQL Management Studio having points in the names of SP's isn't a problem.

Lieven Cardoen

Lieven Cardoen
What version SubSonic are you using? 3 or 2? If you're using 3.0, then you need to update the CleanUp method in the tt files to find/replace the "." with underscores or just remove the "."s. This method is called when it translates the db names to class/method names. You can't have a class or method name with a period in it, since that's used to separate namespaces, classes, methods, properties, etc.
Jim W