这个练手小项目是今年8月刚接触C#的时候做的...当时对C#还不熟,边查资料边完成的,其实有很多需要优化的地方...数据库是提前创建好的,用户名密码什么的直接写在点击连接按钮事件中了,可能未来的某一天想起来这个小项目会回来完善一下
界面
代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace test
{
public partial class Form1 : Form
{
MySqlConnection SQLCon;
MySqlCommand SQLCmd;
int s1;
string s2 = "null", s3 = "null", s4 = "null", s5 = "null", s6 = "null";
public Form1()
{
InitializeComponent();
}
//连接
private void bt_CONNECT_Click(object sender, EventArgs e)
{
string connetStr = "server=localhost;user=root;password=admin;database=testdb;sslMode