mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Remove extra spacing
This commit is contained in:
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with C# and Azure SQL
|
||||
# Developing applications with C# and Azure SQL
|
||||
|
||||
Pick a platform below to get started:
|
||||
* [unix-based (Includes macOS, RHEL, Ubuntu, SLES](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ namespace AzureSqlSample
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string sql;
|
||||
|
||||
|
||||
// Build connection string
|
||||
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
|
||||
builder.DataSource = "your_server_name.database.windows.net"; // update me
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ namespace AzureSQLSample
|
||||
static async Task DoWork(string[] args)
|
||||
{
|
||||
string sql;
|
||||
|
||||
|
||||
// Build connection string
|
||||
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
|
||||
builder.DataSource = "your_server_name.database.windows.net"; // update me
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ namespace AzureSqlEFSample
|
||||
{
|
||||
string sql;
|
||||
Console.WriteLine("** C# CRUD sample with Entity Framework and Azure SQL **\n");
|
||||
|
||||
|
||||
// Build connection string
|
||||
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
|
||||
builder.DataSource = "your_server.database.windows.net"; // update me
|
||||
@@ -65,7 +65,7 @@ namespace AzureSqlEFSample
|
||||
DateTime dueDate2016 = DateTime.Parse("12-31-2016");
|
||||
List<Task> queryResults = context.Tasks.Where(t => t.DueDate < dueDate2016).ToList();
|
||||
foreach (Task t in queryResults)
|
||||
{
|
||||
{
|
||||
Console.WriteLine("Deleting task: " + t.ToString());
|
||||
context.Tasks.Remove(t);
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ namespace AzureSqlSample
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string sql;
|
||||
|
||||
|
||||
// Build connection string
|
||||
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
|
||||
builder.DataSource = "your_server_name.database.windows.net"; // update me
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ namespace AzureSQLSample
|
||||
static async Task DoWork(string[] args)
|
||||
{
|
||||
string sql;
|
||||
|
||||
|
||||
// Build connection string
|
||||
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
|
||||
builder.DataSource = "your_server_name.database.windows.net"; // update me
|
||||
|
||||
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with Go and Azure SQL
|
||||
# Developing applications with Go and Azure SQL
|
||||
|
||||
This information is meant to pair with the steps from [getting started tutorials](https://www.microsoft.com/en-us/sql-server/developer-get-started/), so please follow along there.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
import (
|
||||
_ "github.com/denisenkom/go-mssqldb"
|
||||
"database/sql"
|
||||
"context"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
import (
|
||||
_ "github.com/denisenkom/go-mssqldb"
|
||||
"database/sql"
|
||||
"context"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
db.Model(&user).Related(&tasks)
|
||||
fmt.Printf("%s %s's tasks:\n", user.FirstName, user.LastName)
|
||||
for _, task := range tasks {
|
||||
fmt.Printf("Title: %s\nDueDate: %s\nIsComplete:%t\n\n",
|
||||
fmt.Printf("Title: %s\nDueDate: %s\nIsComplete:%t\n\n",
|
||||
task.Title, task.DueDate, task.IsComplete)
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
func UpdateSomeonesTask(db *gorm.DB, userId int){
|
||||
var task Task
|
||||
db.Where("user_id = ?", userId).First(&task).Update("Title", "Buy donuts for Luis")
|
||||
fmt.Printf("Title: %s\nDueDate: %s\nIsComplete:%t\n\n",
|
||||
fmt.Printf("Title: %s\nDueDate: %s\nIsComplete:%t\n\n",
|
||||
task.Title, task.DueDate, task.IsComplete)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with Java and Azure SQL
|
||||
# Developing applications with Java and Azure SQL
|
||||
|
||||
Pick a platform below to get started:
|
||||
* [unix-based (Includes macOS, RHEL, Ubuntu, SLES](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/java/Unix-based)
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ import com.azure.security.keyvault.secrets.SecretClientBuilder;
|
||||
public class App {
|
||||
String connectionUrl = "jdbc:sqlserver://your_server.database.windows.net"; // update me
|
||||
String userName = "your_user"; // update me
|
||||
String password = "Will_Be_Updated_From_Key_Vault";
|
||||
String password = "Will_Be_Updated_From_Key_Vault";
|
||||
String sampleDatabaseName = "your_db"; // update me
|
||||
|
||||
// Main entry point
|
||||
@@ -59,7 +59,7 @@ public class App {
|
||||
cfg.addAnnotatedClass(Task.class);
|
||||
|
||||
System.out.println("added classes to config");
|
||||
|
||||
|
||||
|
||||
// Hibernate needs an existing database. We already have one created.
|
||||
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ import com.azure.security.keyvault.secrets.SecretClientBuilder;
|
||||
public class App {
|
||||
String connectionUrl = "jdbc:sqlserver://your_server.database.windows.net"; // update me
|
||||
String userName = "your_user"; // update me
|
||||
String password = "Will_Be_Updated_From_Key_Vault";
|
||||
String password = "Will_Be_Updated_From_Key_Vault";
|
||||
String sampleDatabaseName = "your_db"; // update me
|
||||
|
||||
// Main entry point
|
||||
@@ -59,7 +59,7 @@ public class App {
|
||||
cfg.addAnnotatedClass(Task.class);
|
||||
|
||||
System.out.println("added classes to config");
|
||||
|
||||
|
||||
|
||||
// Hibernate needs an existing database. We already have one created.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with NodeJs and Azure SQL
|
||||
# Developing applications with NodeJs and Azure SQL
|
||||
|
||||
Pick a platform below to get started:
|
||||
* [unix-based (Includes macOS, RHEL, Ubuntu, SLES](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/nodejs/Unix-based)
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ async function GetSecret(){
|
||||
const client = new KeyVaultSecrets.SecretClient(url, credential);
|
||||
|
||||
try {
|
||||
secret = await client.getSecret('AppSecret').then((secret) => {
|
||||
secret = await client.getSecret('AppSecret').then((secret) => {
|
||||
password = secret.value;
|
||||
});
|
||||
}
|
||||
@@ -42,7 +42,7 @@ async function GetConnection(){
|
||||
}
|
||||
},
|
||||
options: {
|
||||
encrypt: true,
|
||||
encrypt: true,
|
||||
trustServerCertificate: true,
|
||||
database: 'your_database' // update me
|
||||
}
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ var config = {
|
||||
}
|
||||
},
|
||||
options: {
|
||||
encrypt: true,
|
||||
encrypt: true,
|
||||
database: 'your_database', // update me
|
||||
trustServerCertificate: true,
|
||||
encrypt: true
|
||||
@@ -106,7 +106,7 @@ function Read(callback) {
|
||||
});
|
||||
|
||||
// Print the rows read
|
||||
var result = "";
|
||||
var result = "";
|
||||
request.on('row', function(columns) {
|
||||
columns.forEach(function(column) {
|
||||
if (column.value === null) {
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
var password = 'fetch_from_key_vault'; // fetched from key vault
|
||||
var hostName = 'your_server.database.windows.net'; // update me
|
||||
var sampleDbName = 'your_database'; //update me
|
||||
|
||||
|
||||
|
||||
async function GetSecret(){
|
||||
console.log("Getting secret...");
|
||||
@@ -133,7 +133,7 @@ async function Main() {
|
||||
JSON.stringify(tasks));
|
||||
console.log('\nAll done!');
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ async function GetSecret(){
|
||||
const client = new KeyVaultSecrets.SecretClient(url, credential);
|
||||
|
||||
try {
|
||||
secret = await client.getSecret('AppSecret').then((secret) => {
|
||||
secret = await client.getSecret('AppSecret').then((secret) => {
|
||||
password = secret.value;
|
||||
});
|
||||
}
|
||||
@@ -44,7 +44,7 @@ async function GetConnection(){
|
||||
}
|
||||
},
|
||||
options: {
|
||||
encrypt: true,
|
||||
encrypt: true,
|
||||
trustServerCertificate: true,
|
||||
database: 'your_database' // update me
|
||||
}
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ function Read(callback) {
|
||||
});
|
||||
|
||||
// Print the rows read
|
||||
var result = "";
|
||||
var result = "";
|
||||
request.on('row', function(columns) {
|
||||
columns.forEach(function(column) {
|
||||
if (column.value === null) {
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ var Sequelize = require('sequelize');
|
||||
var password = 'fetch_from_key_vault'; // fetched from key vault
|
||||
var hostName = 'your_server.database.windows.net'; // update me
|
||||
var sampleDbName = 'your_database'; //update me
|
||||
|
||||
|
||||
|
||||
async function GetSecret(){
|
||||
console.log("Getting secret...");
|
||||
@@ -133,7 +133,7 @@ async function Main() {
|
||||
JSON.stringify(tasks));
|
||||
console.log('\nAll done!');
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with PHP and Azure SQL
|
||||
# Developing applications with PHP and Azure SQL
|
||||
|
||||
Pick a platform below to get started:
|
||||
* [unix-based (Includes macOS, RHEL, Ubuntu, SLES](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/php/Unix-based)
|
||||
|
||||
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with Python and Azure SQL
|
||||
# Developing applications with Python and Azure SQL
|
||||
|
||||
Pick a platform below to get started:
|
||||
* [unix-based (Includes macOS, RHEL, Ubuntu, SLES](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/python/Unix-based)
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ ActiveRecord::Base.establish_connection(
|
||||
|
||||
#Create new database SampleDB
|
||||
puts "Drop and create new database 'SampleDB'"
|
||||
ActiveRecord::Base.connection.drop_database('SampleDB') rescue nil
|
||||
ActiveRecord::Base.connection.drop_database('SampleDB') rescue nil
|
||||
ActiveRecord::Base.connection.create_database('SampleDB')
|
||||
ActiveRecord::Base.connection.use_database('SampleDB')
|
||||
|
||||
@@ -22,7 +22,7 @@ ActiveRecord::Schema.define do
|
||||
t.string :taskname
|
||||
t.string :user
|
||||
t.date :duedate
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Task < ActiveRecord::Base
|
||||
|
||||
@@ -17,7 +17,7 @@ execute("DROP DATABASE IF EXISTS [SampleDB]; CREATE DATABASE [SampleDB];")
|
||||
|
||||
# Create sample table with data
|
||||
puts "Creating sample table with data"
|
||||
execute("USE SampleDB; CREATE TABLE Employees (Id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
execute("USE SampleDB; CREATE TABLE Employees (Id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
Name NVARCHAR(50), Location NVARCHAR(50))
|
||||
INSERT INTO Employees (Name, Location) VALUES (N'Jared', N'Australia'),
|
||||
(N'Nikita', N'India'), (N'Tom', N'Germany')")
|
||||
|
||||
@@ -6,7 +6,7 @@ products:
|
||||
- azure-sql-database
|
||||
---
|
||||
|
||||
# Developing applications with Ruby and Azure SQL
|
||||
# Developing applications with Ruby and Azure SQL
|
||||
|
||||
|
||||
Please visit our [getting started tutorials](https://www.microsoft.com/en-us/sql-server/developer-get-started/)
|
||||
|
||||
Reference in New Issue
Block a user