-
Notifications
You must be signed in to change notification settings - Fork 0
Database
We have selected Microsoft Azure Database because our project is based on .NET and we’re using Visual Studio, therefore it makes sense using Microsoft Azure. The Azure plugin allows us to easily connect to our remote database using the Server Explorer in Visual Studio which allows us to quickly view data. Our remote server is located around Central Canada region which is relatively close to our location and runs our SQL database.
When comparing Amazon and Microsoft’s database services, cost does come into play. Microsoft gives students a free 1 year subscription to use their services through the Microsoft Imagine program. Amazon also gives students a 150$ credit which was used. However, initially when we used Amazon Web Services, the configuration was slightly more complex and we realized that there are several hidden charges when using amazon servers and databases. These charges increased quickly and cost per usage time. This was terrible because there had to be further research on understanding what these charges mean and how to prevent them. Therefore, we decided to transition to Microsoft Azure and we have had no issues related to configuration, cost and service.
Our Glimpse.Core Client application communicates with the Web Service ASP.NET project using HTTP Request & Response. The Web Service is the gateway for any communication with the database. The Repository layer of our application communicates with the Web Service and the Web services accesses the database using GET,POST. The responses are then received by Web Service and sent to the client application.
-
Open Visual Studio
-
Open Server Explorer in Views tab
-
Right click on Data Connections in Server Explorer and Add Connection
-
Select MySQL Database as Data source.
-
Enter the following:
- Server name: glimpsetarget.database.windows.net
- User name: adming
- Password: ******** (ask team lead)
-
Select the database name: "glimpsedb"
-
Click OK, you should see in Server Explorer that you are connected to Server "glimpsetarget", remote database "glimpsedb". Expand the db and you will see all tables.
In the Package Manager Console:
1-run Enable-Migrations -ContextTypeName WebServices.Models.Context where ( is a context u want to change)
2-run Add-Migration NameOfMigration
3- migration file has been added to migration folder, if its good enough go to step 5
4- modify migration file for your needs
5- run Update-Database
If you get an error that step 5 that you couldnt connect to the SQL instance, make sure WebService is the start up project.
NOTE: If any changes are done to Models, Do not forget to Publish by Right click on WebServices -> Publish -> Check parameters -> OK
