Create Your Next Application and Database in the Cloud
page 3 of 6
by Vince Varallo
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 25057/ 66

Step 2: Create the Database

1.    You will need to create a Windows Azure account to utilize the Azure services.  You can click here to find the latest offers from Microsoft.  There is usually a free 30 trial introductory offer so you can try before you buy.

2.    Once you've created a Windows Azure account you need to go to http://windows.azure.com to log into the Windows Azure Management Portal.

3.    The management portal is where you can create a new site, called a hosted service, or create a new database.  We'll first create a database and then create a web site with Visual Studio 2010 to display data from a table in the database.

4.    To create a new database click on the "New Database Server" icon at the top of the Management Portal.

5.    On the left side you will see "Subscriptions".  Click on the subscription name that you created when you created your Windows Azure account.  For this sample I'm using the "Windows Azure Pass" subscription.  When you click on it, the buttons on the top toolbar should become enabled.

6.    Click the Create button in the Server section.  This will bring up the "Create Server" wizard.

7.    Select the region where you want your database deployed and click the Next button.

8.    Create an administrator user name and password and click the Next button.

9.    The last page allows you to enable specific IP addresses that can access this server.  You should add your IP address by clicking the Add button.  When you click the Add button another page will display and tell you your current IP address.  Give this rule a name and then enter a start and end range.  In this example I'm using the same address for both.

10. Click the OK button and then click the Finish button.  You'll be brought back to the Management portal and the new server will be added to the subscription.  In this example the new server name is "its88ze5xt".

11. Click on the new server that you just created to highlight the row.  The "Create" button on the Database toolbar should become enabled.  Click the "Create" button.

12. A window will pop up and ask you to give the database a name, pick the edition, and a maximum size.

13. Enter SampleDB for the name and select Web for the edition.  Leave the maximum size at 1GB.  Now click the OK button.

14. The database will be created and will appear under the subscription tree in the left hand pane.

15. Click on the Database in the left hand pane and the "Manage" button should become enabled on the Database toolbar.  Click this button to create a table in the database.

16. The Database Manager will open in a new window and you will need to log in using the same user name and password that you created when you created the server.

17. Once you entered the correct credentials click the Connect button.

18. You may get an error when you click the Connect button.  If you click on the error details you'll see that the error is caused because another IP address needs to be entered in the firewall rule.  The details of the error tell you which IP address to add.  Copy this address and click back to the Management Portal.

19. Click on your server name under the Subscription node in the left hand pane.

20. Click the Firewall Rules button.

21. Click the Add button.

22. Enter another name and then add the IP address that you copied down in step 18.  Now click the OK button.

23. Click back the Database manager window and try to connect again.  You should now be able to log into the Database manager.

24. This is where you can create tables, stored procedures, views, and run queries.  Click on the "New Table" button in the toolbar.

25. The Database Manager will create a table template with 3 fields.  Change the table name to "Person".

26. Change the ID field so it is an Identity field.

27. Change Column1's name to "FirstName".  To change a column name double click on the name and the cursor should appear in the cell.  You can then delete the old and enter the new.

28. Change Column2's name to "LastName".

29. Change both fields to Required.

30. Click the "+ Column" button to add a new column.  Change the name of the new column to "Email" and check the "Is Required" check box.

31. Click the Save button on the toolbar to save the table.  The table should be created.  Click on the ">" button next to the word Tables (1) on the side menu.  You should see the dbo.Person node.

32. Click on the "dbo.Person" node and then click the "Data" button on the toolbar.

33. This brings up a page that allows you to add records to the table.

34. Click the "+ Row" button to add a row to the grid.

35. Double click on a cell to enter a first name, last name, and email.  Add a few records because this is what will be displayed in the application we will build.

36. Click the save button to commit your changes.

Now you can log out of the Database Manager and we will build an ASP.NET web site to pull the data from this table and display it in a GridView control.


View Entire Article

User Comments

Title: garland.kg69@asp.alliance/com   
Name: Kenneth A Garland III
Date: 2011-03-04 12:53:26 PM
Comment:
I wish to have my own web-site in the cloud .
Title: Cloud at GoDaddy   
Name: Kevin Tweedy
Date: 2011-01-25 5:19:44 PM
Comment:
Does anyone have any experience with the Cloud at a GoDaddy hosted area? None of their "Help" [s.i.c.] files reference the Cloud at all and in the past they've been extremely lagging in getting with "the latest and greates". Any pointers, info?

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-26 8:00:00 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search