Skip to content

Commit a3eb8fd

Browse files
committed
Add copilot highlight to mysql windev topic
1 parent 93c7b65 commit a3eb8fd

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

hub/apps/develop/data-access/mysql-database.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: Use a MySQL database in a Windows app
33
description: Learn how to connect to a MySQL database from your Windows app, and test your connection using sample code.
4-
ms.date: 08/01/2024
4+
ms.date: 01/23/2025
5+
ms.collection: ce-skilling-ai-copilot
6+
ms.custom: copilot-scenario-highlight
57
ms.topic: how-to
68
keywords: windows, windows app sdk, MySQL, database, uwp, wpf, winforms, windows forms, winui
79
ms.localizationpriority: medium
@@ -21,6 +23,9 @@ This example can be used with any WPF, Windows Forms, WinUI 3, and UWP project t
2123

2224
This will allow you to programmatically access MySQL databases.
2325

26+
> [!NOTE]
27+
> [MySQL Connector/NET](https://dev.mysql.com/downloads/connector/net/) version 6.4.4 or later is required to use the `MySql.Data` package with Windows authentication.
28+
2429
## Test your connection using sample code
2530

2631
The following is an example of connecting to and reading from a remote MySQL database. Note that the server address and database name will need to be customized.
@@ -46,8 +51,19 @@ using (var mySqlCn = new MySqlConnection(M_str_sqlcon))
4651
> [!IMPORTANT]
4752
> In production applications, connection information should be stored securely in app configuration (see [**Adding Azure App Configuration by using Visual Studio Connected Services**](/visualstudio/azure/vs-azure-tools-connected-services-app-configuration)). Connection strings and other secrets should not be hard-coded.
4853
49-
> [!NOTE]
50-
> [MySQL Connector/NET](https://dev.mysql.com/downloads/connector/net/) version 6.4.4 or later is required to use the `MySql.Data` package with Windows authentication.
54+
## Building a connection string with GitHub Copilot
55+
56+
You can use GitHub Copilot to build the connection string for your MySQL database. You can customize the prompt to create a connection string per your requirements.
57+
58+
The following text shows an example prompt for Copilot Chat that generates a connection string similar to the one shown in the previous code snippet:
59+
60+
```copilot-prompt
61+
Show me how to create a MySQL connection string to a server named myServerAddress and a database called myDatabase. Use Windows authentication.
62+
```
63+
64+
GitHub Copilot is powered by AI, so surprises and mistakes are possible. For more information, see [Copilot FAQs](https://aka.ms/copilot-general-use-faqs).
65+
66+
Learn more about [GitHub Copilot in Visual Studio](/visualstudio/ide/visual-studio-github-copilot-install-and-states) and [GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/overview).
5167

5268
## Related content
5369

0 commit comments

Comments
 (0)