Silverlight WCF Ria Services app built with Visual Studio 2012 fails while creating Users table for membership - wcf-ria-services

I am creating a Silverlight 5 application with RIA Services under Windows 8 and Visual Studio 2012. I added a model pointing to my database, created the domain service and everything works fine.
Now I need to add membership functionality and so I was thinking of using the good'old aspnet_regsql to add the new tables, views, sprocs, etc. needed by the ASP.NET subsystem.
I learned here http://dotnet.dzone.com/articles/stronger-password-hashing-net that aspnet_regsql is no longer used and that a Universal Provider is now used.
However, my database already contained a table named Users and so after I tried to log in to the newly created app (as suggested here: ASP.NET Universal Providers and Session State), the other tables got created, but the Users table didn't (since it already existed).
Then when I try to run the app and create a new user, the app crashes on line 62 of the default UserRegistrationService.cs file that says:
Membership.CreateUser(user.UserName, password, user.Email, user.Question, user.Answer, true, null, out createStatus);
The inner exception of that error is:
Invalid column name 'ApplicationId'.\r\nInvalid column name 'UserName'.\r\nInvalid column name 'ApplicationId'.\r\nInvalid column name 'UserName'.\r\nInvalid column name 'IsAnonymous'.\r\nInvalid column name 'LastActivityDate'.
I think the problem is that the Users table didn't get created. But I don't know how to fix this problem.
Any suggestions?
Thanks to all!
Trex

Related

Security Exception when loading the site after Kentico upgrade from v9 to v10

After upgrading the existing v9 site to Kentico 10 I'm getting a security exception error when loading the site. The CMS admin however loads fine. I already added the FULL trust setting in web.config but it did not work. Any idea?
Problem, based on part that I can see and exception type would be in new SQL parser which was added in one of the hotfixes for v9 and thus it is part of v10.
You seem to be using one of the properties in a web part and than passing incomplete query via ##WHERE## macro. If a where condition is like {%CurrentDocument.DocumentID%} it is not a valid WHERE and whole property has to be complete SQL statement on its own, so it could be like DocumentID = {%CurrentDocument.DocumentID%}.
You can find a bit more in this thread:
https://devnet.kentico.com/questions/invalid-sql-query-error-on-a-page
Try load the template in the Admin UI pages application, then check the event log application, you should see the detail information about the SQL error. Most likely you have a SQL call that is trying to get some data from a column that's no longer there (through upgrade).

Create databasebase with entity framework code first approach

I do not want that my database is created when I insert a record. One reason is I do not want to create sample application, do an insert just to have a database...
I want that my database is created via the package manager console.
How can I do that?
It's a little unclear what you're asking, but I think you're trying to prevent the database from being created automatically from the application code.
The database is created on the first use of the DataContext. If you don't want the database to be created on the first use of the data context you can add Database.SetInitializer<YourContextClassHere>(null); to your Global.asax.cs file.
Then you could use the Update-Database cmdlet in Visual Studio to run the pending migrations including creating the database.

sqlite does not see new tables I added to the db

I have a database that has 7 tables and am calling them from my app simply using sqlite queries ...
am not new to this I made to apps work greatly even with encryption ..
am building now a new app and decide to add 2 new tables my db ,
but when I call them sqlites doesnot see them and return me with an error "No such table :history"
I have added these new tables simply using sqlitemanger add-on that comes with firefox as I always do.
In the terminal I can see them and I can get data from them , but that is not the case in my app..
do you have any idea?!!
Try to delete your app from simulator and run it again.I think your updated database is not copied.

EF Code First not working on deploy hosting

I've an application using MVC and Code First for persistence.
Everything works fine in my development, but when I'm uploading to server, it doesnt work.
In any place i try to create a database, but it keeps me returning the following error: CREATE DATABASE permission denied in database 'master'.
The only thing that i do is override the OnModelCreating method just to map my app.
Anyone has this error?
Thanks
For a tutorial series that shows how to publish your Code First database and prevent Code First from trying to re-create the database in production, see
http://www.asp.net/mvc/tutorials/deployment-to-a-hosting-provider
The third tutorial in the series shows how to set up the Web.config file. The second shows how to deploy if you are using SQL Server Compact, the tenth shows how to deploy to full SQL Server.
You'll need to publish your database out to your hosting provider. Visual Studio has an easy way of doing this. In the server explorer tab, you can navigate to your database, right click and choose publish to provider. By doing this, you will not only export the scheme of your database, but you can also export out all data, stored procs, views etc.
You will need to adjust your code so that you are no longer trying to create a database on code run. Typically this approach is used for development, and you are no longer in development if you're moving to a hosting company. The changes may be in your global.asax, the dbcontext of your solution and any other place where you modified it to create the scheme for the database.
Hope this helps you some, and good luck on your project.

Unable to change data source in Crystal reports 9

I have a report set up on our test environment which uses a datasource called DEFAULT, which is also the name of the datasource on the client's production server. (Both are ODBC)
The databases in our test environment are called systemname_clientname but on site they are simply systemname.
I modified a report for the client and put it onsite then changed the datasource to the client version (DEFAULT.systemname) but the report keeps throwing errors saying that the object systemname_clientname.dbo.table does not exist.
I can't seem to make it realise that it is no longer pointing at the systemname_clientname database.
This is using Crystal Reports 9 and the reports are launched using an ASP page written in VBScript.
Google has been most unhelpful and my co-workers are equally stumped, can anybody offer some help here?
Database->Set Datasource Location has a bug in Crystal XI at least, maybe other versions.
Select the database and then updating doesn't update the source of every table.
If you expand the properties of each table you will see that it's still pointing at the old data source.
Try updating the data source for each table one by one.
Yes, it is tedious, sorry.