Cara Membuat Aplikasi Dengan Visual Studio
This quickstart shows how to use the .NET Framework and C# code in Visual Studio to query an Azure SQL database with Transact-SQL statements.
Prerequisites
To complete this quickstart, you need:
Assalamualaikum Kawan cronyos, Kali ini saya akan berbagi sedikit tentang permrograman VB.net kebetulan saya memakai Visual Studio 2010, yaitu cara membuat File exe dari projek kita di VB.net, Berikut caranya: 1. Pertama buka project sobat, lalu klik Project, klik Properties. Pada artikel ini kita akan membuat aplikasi dengan form-form Microsoft Windows menggunakan versi Visual Studio yang gratis yaitu Visual Studio Community 2013. Berikut langkah-langkah membuat C# Windows Forms Application. Membuat project seperti gambar di bawah ini Klik OK Hasil yang didapatkan adalah seperti gambar berikut ini.
An Azure SQL database. You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
Single database Managed instance Create Portal Portal CLI CLI PowerShell PowerShell Configure Server-level IP firewall rule Connectivity from a VM Connectivity from on-site Load data Adventure Works loaded per quickstart Restore Wide World Importers Restore or import Adventure Works from BACPAC file from GitHub Important
The scripts in this article are written to use the Adventure Works database. With a managed instance, you must either import the Adventure Works database into an instance database or modify the scripts in this article to use the Wide World Importers database.
Visual Studio 2019 Community, Professional, or Enterprise edition.
Get SQL server connection information
Get the connection information you need to connect to the Azure SQL database. You'll need the fully qualified server name or host name, database name, and login information for the upcoming procedures.
Sign in to the Azure portal.
Navigate to the SQL databases or SQL managed instances page.
On the Overview page, review the fully qualified server name next to Server name for a single database or the fully qualified server name next to Host for a managed instance. To copy the server name or host name, hover over it and select the Copy icon.
Create code to query the SQL database
In Visual Studio, select File > New > Project.
In the New Project dialog, select Visual C#, and then select Console App (.NET Framework).
Enter sqltest for the project name, and then select OK. The new project is created.
Select Project > Manage NuGet Packages.
In NuGet Package Manager, select the Browse tab, then search for and select System.Data.SqlClient.
On the System.Data.SqlClient page, select Install. Download kaplan toefl cd for mac.
- If prompted, select OK to continue with the installation.
- If a License Acceptance window appears, select I Accept.
When the install completes, you can close NuGet Package Manager.
In the code editor, replace the Program.cs contents with the following code. Replace your values for
<server>
,<username>
,<password>
, and<database>
.Important
The code in this example uses the sample AdventureWorksLT data, which you can choose as source when creating your database. If your database has different data, use tables from your own database in the SELECT query.
Run the code
- To run the app, select Debug > Start Debugging, or select Start on the toolbar, or press F5.
- Verify that the top 20 Category/Product rows from your database are returned, and then close the app window.
Next steps
- Learn how to connect and query an Azure SQL database using .NET Core on Windows/Linux/macOS.
- Learn about Getting started with .NET Core on Windows/Linux/macOS using the command line.
- Learn how to Design your first Azure SQL database using SSMS or Design your first Azure SQL database using .NET.
- For more information about .NET, see .NET documentation.
- Retry logic example: Connect resiliently to SQL with ADO.NET.