using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        MySqlConnection con = new MySqlConnection("Host = localhost;Database = www;" + "Username = root; Password = 123456");

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            MySqlCommand com1 = new MySqlCommand();
            com1.Connection = con;
            com1.CommandText = "insert into user values(014,'小花','高二','sser')," + "(84,'小花01','高三','和谐')";
            int i = com1.ExecuteNonQuery();
            con.Close();
        }
    }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2022-02-07
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案