using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
namespace 数据库
{
///
/// MainWindow.xaml 的交互逻辑
///
public partial class MainWindow : Window
{
//public string myConnectionString { get; private set; }
public MainWindow()
{
InitializeComponent();
}
String myConnectionString = "server=localhost;port=3306;user=root;password=123456; database=management;";
//端口号port默认是3306可以不写,user:用户名,password:密码,database:数据库名
private void GetData()
{
MySqlConnection connection = new MySqlConnection(myConnectionString);
connection.Open();
if (connection.State == System.Data.ConnectionState.Open)
{
connection.Close();
Loa