using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
namespace 添加数据
{
class Program
{
static void Main(string[] args)
{
String connetStr = "server=127.0.0.1;port=3306;user=用户名;password=密码.; database=数据库名";
MySqlConnection conn = new MySqlConnection(connetStr);
try
{
conn.Open();
Console.WriteLine("已经建立连接");
string str = "insert student values('小华',8,22);"; //sql语句,添加记录
MySqlCommand co = new MySqlCommand(str, conn); //往表内添加记录
//MySqlCommand co = new MySqlCommand();
//co = new MySqlCommand(str, conn); //往表内添加记录(同上&