Re: [Firebird-net-provider] Exception using Firebird .NET provider and SimpleMembershipProvider in MVC4
I managed to write my own membership provider, turns out it wasn't hard after all -- I just had to find the relevant information out of everything that's out there :) In case anyone else needs this information: I created a new class extending ExtendedMembershipProvider, I implemented the methods similar to this example: http://msdn.microsoft.com/en-us/library/6tc47t75(v=vs.100).aspx For a minimal membership provider it's sufficient to only implement a few methods: ValidateUser, CreateUser, GetUser and the properties MinRequiredPasswordLength, RequiresUniqueEmail. http://www.codeproject.com/Articles/165159/Custom-Membership-Providers Regards, Markus -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Exception using Firebird .NET provider and SimpleMembershipProvider in MVC4
Jiri and Paul, thanks for your quick repsonses. Just to confirm, I should do something like this: http://www.codeproject.com/Articles/165159/Custom-Membership-Providers Please let me know if I'm finally on the right track :) Thanks, Markus On Wed, Feb 27, 2013 at 5:02 PM, Mercea Paul paul.mer...@almexa.ro wrote: Hi Markus On 2013.02.27 4:33 PM, Markus Ostenried wrote: 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 DbProviderFactoriesremove 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.QueryInternald__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 You have 2 options: 1. Use existing Firebird Membership a. First create a ASP.Net MVC3 application an close the solution. b. Create a ASP.Net MVC4 application. c. Copy from MVC3 Account controller and model. d. Configure web.config as usual FBMembershipProvider. 2. Write you own membership. You can view the sources from http://aspnetwebstack.codeplex.com/ as sample. HTH, Paul MERCEA ___ E-mail: paul.mer...@almexa.ro ___ -- Everyone hates slow websites. So do we. Make your web apps faster
[Firebird-net-provider] Exception using Firebird .NET provider and SimpleMembershipProvider in MVC4
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 DbProviderFactoriesremove 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.QueryInternald__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 -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Exception using Firebird .NET provider and SimpleMembershipProvider in MVC4
Hi Markus On 2013.02.27 4:33 PM, Markus Ostenried wrote: 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 DbProviderFactoriesremove 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.QueryInternald__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 You have 2 options: 1. Use existing Firebird Membership a. First create a ASP.Net MVC3 application an close the solution. b. Create a ASP.Net MVC4 application. c. Copy from MVC3 Account controller and model. d. Configure web.config as usual FBMembershipProvider. 2. Write you own membership. You can view the sources from http://aspnetwebstack.codeplex.com/ as sample. HTH, Paul MERCEA ___ E-mail: paul.mer...@almexa.ro ___ -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider