Události
Vytváření inteligentních aplikací
17. 3. 21 - 21. 3. 10
Připojte se k řadě meetupů a vytvořte škálovatelná řešení AI založená na skutečných případech použití s kolegy vývojáři a odborníky.
ZaregistrovatTento prohlížeč se už nepodporuje.
Upgradujte na Microsoft Edge, abyste mohli využívat nejnovější funkce, aktualizace zabezpečení a technickou podporu.
Work with data and resources stored in Azure Database for MySQL.
The recommended client library for accessing Azure Database for MySQL is MySQL's Connector/Net. Use the package to connect to the database and execute SQL statements directly.
Install the NuGet package directly from the Visual Studio Package Manager console or with the .NET Core CLI.
Install-Package MySql.Data
dotnet add package MySql.Data
Connect to a MySQL database and execute a query:
/* Include this "using" directive...
using MySql.Data.MySqlClient;
*/
string connectionString = "Server=[servername].mysql.database.azure.com; " +
"Database=myDataBase; Uid=[userid]@[servername]; Pwd=myPassword;";
// Best practice is to scope the MySqlConnection to a "using" block
using (MySqlConnection conn = new MySqlConnection(connectionString))
{
// Connect to the database
conn.Open();
// Read rows
MySqlCommand selectCommand = new MySqlCommand("SELECT * FROM MyTable", conn);
MySqlDataReader results = selectCommand.ExecuteReader();
// Enumerate over the rows
while(results.Read())
{
Console.WriteLine("Column 0: {0} Column 1: {1}", results[0], results[1]);
}
}
Zpětná vazba k produktu Azure SDK for .NET
Azure SDK for .NET je open source projekt. Vyberte odkaz pro poskytnutí zpětné vazby:
Události
Vytváření inteligentních aplikací
17. 3. 21 - 21. 3. 10
Připojte se k řadě meetupů a vytvořte škálovatelná řešení AI založená na skutečných případech použití s kolegy vývojáři a odborníky.
Zaregistrovat