Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Azure Database Windows Azure SQL Database is a feature-rich, fully managed relational database service that offers a highly productive experience,

Similar presentations


Presentation on theme: "SQL Azure Database Windows Azure SQL Database is a feature-rich, fully managed relational database service that offers a highly productive experience,"— Presentation transcript:

1

2 SQL Azure Database Windows Azure SQL Database is a feature-rich, fully managed relational database service that offers a highly productive experience, incorporates proven SQL Server technology, and delivers business-class capabilities. SQL Database allows customers to scale business apps for burst and global reach by removing the high costs of building an infrastructure which would accommodate occasional peak loads.

3 SQL Azure Database Customers can also remove the security risks and hassles associated with hosting public-facing apps & websites from within a datacenter by quickly & cost-effectively building websites and mobile & social apps directly on SQL Database.

4 Step 1: Create a Windows Azure account Open a web browser, and browse to http://www.windowsazure.com. To get started with a free account, click free trial in the upper right corner and follow the steps. Your account is now created. You are ready to get started.

5 Step 2: Connect to Windows Azure and create a database Sign in to the Management Portal. You should see a navigation pane that looks like this.

6

7 Click New at the bottom of the page. When you click New, a list rolls up the screen showing things you can create. Click SQL Database and then click Custom Create. Choosing this option lets you create a new server at the same time, with you as the administrator. As the system administrator, you can perform more tasks, including connecting to the Management Portal for SQL Database, which you will do later in this tutorial.

8

9 The Database Settings page appears when you click Custom Create. In this page, you provide basic information that creates an empty database on the server. Adding tables and data will come in a later step. Fill out the Database Settings page as follows:

10

11

12 Step 3: Configure the firewall To configure the firewall so that connections are allowed through, you'll enter information on the server page. Note: The SQL Database service is only available with TCP port 1433 used by the TDS protocol, so make sure that the firewall on your network and local computer allows outgoing TCP communication on port 1433. For more information, see SQL Database Firewall.

13 In the navigation pane on the left, click SQL Databases. Click Servers at the top of the page. Next, click on the server you just created so that you see a white arrow to the right. Click on the arrow to open the server page.

14

15

16 Copy the current client IP address. This is the IP address that your router or proxy server is listening on. SQL Database detects the IP address used by the current connection so that you can create a firewall rule to accept connection requests from this device. Paste the IP address into both the beginning and end range. Later, if you encounter connection errors indicating that the range is too narrow, you can edit this rule to widen the range. Enter a name for the firewall rule, such as the name of your computer or company. Click the checkmark to save the rule. After you save the rule, your page will look similar to the following screenshot.

17

18 To create a table and add data follow the steps next

19

20

21

22

23

24

25

26 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; using System.Data;

27 private static string userName = "SQLServer"; private static string password = "gsmenergy@123"; private static string dataSource = "gct870i4ka.database.windows.net"; private static string sampleDatabaseName = "ContactsDB";

28 SqlConnectionStringBuilder connString1Builder; connString1Builder = new SqlConnectionStringBuilder(); connString1Builder.DataSource = dataSource; connString1Builder.InitialCatalog = "ContactsDB"; connString1Builder.Encrypt = true; connString1Builder.TrustServerCertificate = false; connString1Builder.UserID = userName; connString1Builder.Password = password;

29 using (SqlConnection conn = new SqlConnection(connString1Builder.ToString())) { using (SqlCommand command = conn.CreateCommand()) { conn.Open(); command.CommandText = "SELECT * FROM contacts"; using (SqlDataReader reader = command.ExecuteReader()) { // Loop over the results while (reader.Read()) { Console.WriteLine("{0}, {1}, {2}, {3}“, reader["ID"].ToString(),reader["FirstName"]. ToString(), reader["LastName"].ToString(), reader["ContactNO"].ToString()); }

30 Console.ReadKey(); conn.Close(); }


Download ppt "SQL Azure Database Windows Azure SQL Database is a feature-rich, fully managed relational database service that offers a highly productive experience,"

Similar presentations


Ads by Google