From: Markus O. <ma...@gm...> - 2013-02-27 14:33:59
|
Hi all, I've been using Firebird with Delphi for many years, wrote a few .NET applications and have experience in web development. However: I never did web development with .NET and my only experience with the Firebird .NET provider was a hello world program in Mono on Debian a few years ago. My task is to write a simple web application using ASP.NET which connects to an existing Firebird database. User authentication has to use data in an existing table and I need to display data returned from a stored procedure. Updating data should call another stored procedure. I did some research and read quite a few articles about ASP.NET which led me to trying out MVC4, also the SimpleMembershipProvider sounded like what I need (I'm open for suggestions here). I have installed NETProvider-3.0.2.0 and DDEXProvider-3.0.0.0, created a new MVC4 Internet application, and in web.config adjusted/added the following: <connectionStrings> <add name="DefaultConnection" connectionString .... <DbProviderFactories><remove invariant="FirebirdSql.Data.FirebirdClient"/> <add name="Firebird Data Provider"...... When I run the application and click on the "Register" link I get the following exception: {"The ASP.NET Simple Membership database could not be initialized. ..."} inner exception: {"Dynamic SQL Error\r\nSQL error code = -104\r\nToken unknown - line 1, column 33\r\n."} with stack trace: at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior) at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at WebMatrix.Data.Database.<QueryInternal>d__0.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source) at WebMatrix.Data.Database.QuerySingle(String commandText, Object[] args) at WebMatrix.WebData.DatabaseWrapper.QuerySingle(String commandText, Object[] parameters) at WebMatrix.WebData.SimpleMembershipProvider.CheckTableExists(IDatabase db, String tableName) at WebMatrix.WebData.SimpleMembershipProvider.CreateTablesIfNeeded() at WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) at WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) at WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) at MvcApplication1.Filters.InitializeSimpleMembershipAttribute.SimpleMembershipInitializer..ctor() in d:\Dinge\Documents\Visual Studio 2012\Projects\MvcApplication1\MvcApplication1\Filters\InitializeSimpleMembershipAttribute.cs:line 41 InitializeSimpleMembershipAttribute.cs:line 41 looks like this: WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); which is called by: public override void OnActionExecuting(ActionExecutingContext filterContext) { // Ensure ASP.NET Simple Membership is initialized only once per app start LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock); } Can you tell me what went wrong here? Also, in general, how would I debug an error like this? I'd like to know what SQL statement was being executed but I couldn't find it in the exception dialog. Are there any log files? How can I step into the provider code? I'd be thankful for any hints on how to implement my application. Maybe I need to start from a different application template or use a different membership provider? TIA, Markus |