测试数据库连接
1.连接数据库
//server="地址",我用的是phpmyadmin,所以地址为localhost
using (MySqlConnection msconnection = new MySqlConnection("server=localhost;database=dbname;user=root;pwd=root"))
2.查找数据
MySqlCommand mscommand = new MySqlCommand("select * from person", msconnection)
原创
2021-04-23 18:09:35 ·
1309 阅读 ·
0 评论