https://brunch.co.kr/@hvnpoet/133
Azure SQL Database
1) DB
2) SQL
(6번 pdf)
1) 한국어 패치
2) 시간등 설정
https://www.w3schools.com/sql/sql_ref_keywords.asp
https://www.w3schools.com/sql/sql_create_table.asp
1) tabke statement
2) example
3) primary key
칼럼 지정 INSERT INTO member(Names, Addr, Mobile, Email) VALUES ('이동욱', '서울시 강서구', '010-2967-1016', 'ldw@naver.com')
1) Ctrl + F5
Server = <AzureSQL서버이름>.database.windows.net; database = BookStore; uid = ; pwd =
https://www.csharpstudy.com/Data/SQL-connection.aspx
2) ADO.NET
using System;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace WinFormsApp1
{
public partial class Form1 : Form
{
private string server = "<your_mysqlserver-15.database.windows.net>";
private string database = "BookStore";
private string uid = "<your_azureuser>";
private string pwd = "<your_password>";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Combine server, database, uid, and pwd into a connection string
string connectionString = $"Server={server};Database={database};Uid={uid};Pwd={pwd};";
}
private void button1_Click(object sender, EventArgs e)
{
string connectionString = $"Server={server};Database={database};Uid={uid};Pwd={pwd};";
using (SqlConnection DBConn = new SqlConnection(connectionString))
{
try
{
DBConn.Open();
if (DBConn.State == System.Data.ConnectionState.Open)
{
MessageBox.Show("연결되었습니다.");
}
}
catch (Exception ex)
{
MessageBox.Show($"연결에 실패했습니다. 오류 메시지: {ex.Message}");
}
}
}
}
}
https://www.csharpstudy.com/Data/SQL-command.aspx
https://www.microsoft.com/ko-kr/download/details.aspx?id=101064