How to Create a Windows Azure SQL Database
Part 1 of 4:
Creating a Windows Azure SQL Database
- Log in to your Windows Azure management portal.
- Click on the NEW button in the bottom left corner.
Then, it will show you a wizard. - Choose Data Services from the first pane, then select SQL Database.
- Select Quick Create.
- It will show a dialog, to enter name, select server and data center's region for your database.
- Enter the name for your database, and choose New SQL database server in the SERVER if you don't have any.
- Choose a login name which will be your username to access the database. Enter a strong password to meet the following requirements.
- The password must meet the following requirements:
- More than eight characters in length
- Does not contain all of the login name
- Contains characters from at least three of the following categories:
-English uppercase characters (A through Z)
-English lowercase characters (a through z)
-Base 10 digits (0 through 9)
-Non-alphanumeric characters (example: !, $, %)
- The password must meet the following requirements:
- Click Create SQL Database. Then you will see the following process.
When the process is completed, you will see your database name in "'all items"' list in management portal. Now your database is created successfully!
Part 2 of 4:
Allow your IP address for your client app to connect to the server
- Manage firewalls. To allow your client app to connect to your database, you need to add client pc's IP address to allowed list. To do so -
- Click on SQL Databases in management portal. You will see a list of current databases in your Management Portal.
- Click on Cars database.
- Click on Dashboard in menu.
- Click on 'Manage allowed IP addresses' link in Quick Glance.
- Click on Add to the Allowed IP Address against your current client IP Address
- Click on Save button in the bottom bar.
- Now you are done managing your database connectivity settings. You can now connect your database to your client app.
Part 3 of 4:
Make Some Changes to Database
- Add some table to the database. To do so -
- Click on Databases.
- Click on Cars database
- Click on 'Design your SQL database' link in Cars database management window.
- A new Window will open.
- Put your username and password you entered for your database in this window.
- Click on "Log On" button. Now you will see the SQL DATABASE Management Portal.
- Click on Design in the bottom left corner.
- Click on New Table to create a new table in database.
- Click on "Identity?" against column ID
- Make columns as shown in the image below.
- Click on Save.
- Click on Data.
- Add some rows of data
- Click on Save.
Part 4 of 4:
Checking Database Connectivity
- Copy Connection String from your Cars database Dashboard. To do so -
- Go to Dashboard and click Show Connection Strings in Quick Glance.
- Copy the ADO.NET Connection String
and replace the "default password" with the password your entered in credentials of database. - Make a simple console application in Visual Studio and enter this code in the Main() function.
- Collapse | Copy Code | try
{
Console.WriteLine("Creating Connection");
var conn = new SqlConnection(/* CONNECTION STRING HERE */ );
var cmd = new SqlCommand("Select * From Manufacturers", conn);
Console.WriteLine("Opening Connection!");
conn.Open();
Console.WriteLine("Connection Opened");
Console.WriteLine("Executing Query");
var result = cmd.ExecuteReader();
Console.WriteLine("Query Executed!");
Console.WriteLine("Manufacturers found in database:");
while
(result.Read())
{
object[] rowArr = new object[result.FieldCount];
result.GetValues(rowArr);
Console.WriteLine("t"+rowArr[1]);
}
Console.WriteLine("Closing Connection!");
conn.Close();
}
catch (Exception ex)
{
Console.WriteLine("Error Occuredn"+ ex.Message);
}
Console.Read();
- Run the application.
- It gives the following output, which means that everything is running OK and the SQL query is run against the server successfully, returning the rows of data.
- It gives the following output, which means that everything is running OK and the SQL query is run against the server successfully, returning the rows of data.
4.5 ★ | 2 Vote
You should read it
- How to import Recovery Console in Windows XP?
- A serious vulnerability on phpMyAdmin allows an attacker to destroy the database
- Test about database security P8
- Install and use Recovery Console in Win XP
- How to Create a Database from an Excel Spreadsheet
- How to create a database in MySQL
- How to Access a Virtual Server Console using vCloud Director
- How to recover the database in MS SQL Server
May be interested
- Learn about Microsoft Operations Studio from Microsoftsql operations studio is a free tool that runs on windows, macos and linux, to manage sql server, sql azure database and sql azure data warehouse or wherever they run.
- How to join Azure Active Directory domain (ADD) on Windows 10in this tutorial, you will learn how to add an azure active directory domain (add) on a windows 10 computer.
- Create Database in MongoDBthe use database_name command in mongodb is used to create the database. this command will create a new database, if it does not exist yet, otherwise, this command will return the existing database.
- Create Active Directory accounts from the Exchange database (Part 1)what can you do with a mailbox database? in an incident scenario, we lost the domain controller and didn't have any backups, an exchange server database would be very useful in this case and could save a lot of time in the future.
- How to Create an ARM-Based Linux Virtual Machine with Azurethe number of arm computers is increasing. if you want solid proof, look no further than the new arm-based macbook or the pocket-sized raspberry pi.
- Microsoft Azure Arc will support OpenShift and Red Hat Enterprise Linuxwith azure arc, you can manage linux and windows servers, as well as kubernetes clusters on any infrastructure.
- What is Microsoft Azure?cloud computing has recently become a game changer for businesses, and microsoft azure is one of the companies leading the game.
- How to Create a Secure Session Management System in PHP and MySQLthis guide will show you how you can store your sessions securely in a mysql database. we will also encrypt all session data that goes into the database, which means if anyone manages to hack into the database all session data is encrypted...
- Microsoft offers a $ 100,000 award to hackers of the Azure Sphere operating systemthe challenge participant will have 3 months to try to crack security and successfully penetrate azure sphere os, a customized version based on linux os.
- Use the ALTER DATABASE command to migrate DATABASE in SQL Servertechnically, you can use the alter database syntax to move any system or user database files that define, initialize, except for the resource database.