MVC 4 connect to MySQL - mysql

I've created an Internet application (MVC 4) in VS2012 and I'm trying to connect it to MySQL in a way so that I can have the OAuth functional.
I didn't manage to find anything helpful and I wonder if it's possible without some heavy workaround.

Check this article
Implementaion of SingleMemmbershipProvider in MVC 4 for MySql and supports OAuth additionally.
http://www.mattjcowan.com/funcoding/2012/11/10/simplemembershipprovider-in-mvc4-for-mysql-oracle-and-more-with-llblgen/

OAuth with MVC 4 template uses SimpleMembershipProvider Class which in turn uses MSSQL database. If you need to make it work for MySQL, then you need to override the methods in this class. You can do that as given at this link by Imran but according to me it is very heavy workaround to build your own overridden methods. Instead, drop the inbuilt OAUth and use custom one like sharpOAuth

Related

angular back-end with mysql

Good evening!
I would like to create a web application with Angular 6 but I would like to have Back-end mysql (This is the only basic form I understand a bit) only. Is it possible to have mysql as back-end and without having to use php?
I heard also about mongodb, but can we make requests with conditions for this management system (WHERE, LIKE ... as in sql).
There are two layers in your application - Angular is your front-end presentation layer and an API/Web Service is your back-end data layer which returns JSON data to the front-end. You can use any RDBMS provided your API service supports it. For example, .NET WebAPI supports MySQL through .NET Connector. You can use a variety of API platforms - PHP supports mysql through mysqli and other frameworks.
No, you can not communicate directly between Angular and MySQL. You'll need to build a back-end Web service that calls MySql using php or node. Angular can communicate with this back-end Web service via http.
Here are the steps you need:
1) Learn Angular. Start with the tutorial here: https://angular.io/tutorial
2) Learn how to build a back-end Web service to talk to your mysql backend. You could use php or node.js. See this article for more information. https://www.quora.com/How-do-I-connect-MySQL-to-an-Angular-4-application
3) Learn how to use Angular's http feature to talk to the back-end Web service. (Using the above linked tutorial for help.)
NOTE: You could use firebase instead. It does NOT require that you build a back-end Web service as it provides its own. You can find out more here: https://angularfirebase.com/ or here: https://github.com/angular/angularfire2
If you use Angular in front-end, you can use any backend with it to connect to MySQL database, for example:
Jersey web service written in Java
Php with mysqli
You can also use noSQL database with MongoDB or firebase.
The choice depends on the structure of your database (so you decide if it is better to have relational on noSQL database) and another very important thing is the hosting plan on which you want to deploy your website. If you have a shared server on which you have mySQL and you want to create a relational database, I recommend you to use the following architecture (Angular as front-end, php mysqli as back-end only to select/update from database, and mySQL to store database).

PrimeFaces built-in CRUD?

I'm pretty new to PrimeFaces and I'd need to setup a basic CRUD User Interface. From the showcase I can see there is a built-in Datatable parameter named editable to enable editing. I wonder if there is any built-in feature to enable also Adding and Deleting items.
If not, what would be the simplest way to achieve it ? Maybe using a Dialog component to collect the new items ?
Thanks
The simplest way to get a CRUD would be to reverse engineer it. Create your tables in a database and in Netbeans 7 or 8 (I use 8) create
Entity classes from database
JSF pages from entity classes
During the second point you can choose between Primefaces and plain JSF. If you prefer, you could also skip the first point and code the entity classes yourself instead, and tell the server to create the tables on start.
This will get a full CRUD running, complete with theming, menustructure and templating, using primefaces, facelets, beans, custom entity converters, EJB's, entities and JPA.
I like most of the generated code quite well and there is a lot to learn from it as a beginner. The result is a full page for the list and dialogs (via ui:include's) for create, view and edit.
I'd think Eclipse has something similar.

Can asp.net accomplish this?

I developed a simple webapp using tomcat/mysql. On the tomcat I use a REST interface to be able to interact with the client (using javascript). Since I have no knowledge of asp.net I would like to know whether asp.net could serve as a substitute for the above. I.e. provide a REST-Interface which I can contact using ajax and connect to a mysql database.
Thank you in advance.
Yes it can. However, Windows Communication Foundation would be a better technology to use for that.

How to interact with a MySQL database using winJS?

I just started with Win 8 apps and I need to create an app that interacts with a MySQL database. I think I will go with the HTML5 & WinJavascript way but I have not seen a way about how to do it.
Can somebody give me some example using queries like select, insert and delete on WinJS?
I know some Javascript and HTML, and the lifecycle of a Win app. I tried to search for answers on how to connect to a database but I could not find anything.
WinJs is Javascript.
You can use Ajax to call webservice that will perform your queries.
Or if you don't have too big of a database I recommend you use Azure Mobile Services for storing your data. It's very well integrated with WinJs and it make it easy to work with.

web service json mssql kendo ui connection... how to

Im new at web programming and I have to make a website which will get the data from a mssql server. The thing I tried is just write SQL commands and get the data but I need to change the settings of internet explorer so it did not work. Now I want to write a web service to get the data form my server and formats the data like .json and then I need to use that service to display my list on my website. What is your suggestion where should I begin to work ? And Im using KendoUI for my website.
The easiest and probably most used approach nowadays is to use an ORM - most common EntityFramework for .NET developers, then in your web service you just return the objects and they are automatically serialized.
Search the web for some tutorials.