这里用到的是mysql的dll文件,其他数据库连接方法类似
<connectionStrings>
<add name="sbd" connectionString="Data Source=localhost;port=3306;Initial Catalog=sbd;uid=root;pwd=sgcis;SslMode=none;" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
连接数据库字符串
“Data Source=localhost;port=3306;Initial Catalog=sbd;uid=root;pwd=123456;SslMode=none;”