In the last two days I refactored a lot of Stored Procedures. Today I ran SubSonic and tried the application and I got this error that drove me crazy until 5 minutes ago:

[code]
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:UsersLIC.TELEVIC_PROJECTS_TELEVICEdumatic3edumatic-3-framework-server-.NETEdumatic3.BusinessMetaDataLogic.cs:line 68

at Edu3.Service.MetaDataService.LoadAllLibraries() in C:UsersLIC.TELEVIC_PROJECTS_TELEVICEdumatic3edumatic-3-framework-server-.NETEdumatic3.ServicesMetaDataService.cs:line 34
[/code]

Well, I refactored the sp’s and I replaced _ in names by . (that’s a point). Apparently the points were the whole problem. A SP named [dbo].[sp.Edu3.CopyBlock] doesn’t work, but [dbo].[sp_Edu3_CopyBlock] does…

Would like to know the reason for this…

Lieven Cardoen aka Johlero

pixel SubSonic Problem Stored Procedures
No TweetBacks yet. (Be the first to Tweet this post)