我在使用“ADO.NET Driver for MySQL (Connector/NET)”连接到 mysql 数据库时遇到问题
我得到了这个异常The given key was not present in the dictionary.
Edit:
MySqlConnection con = new MySqlConnection("Server=localhost;Database=pgs_db;Uid=root;Pwd=;");
MySqlCommand com = new MySqlCommand();
com.CommandType = CommandType.StoredProcedure;
com.Connection = con;
com.CommandText = "getStudent";
con.Open();
MySqlDataReader dr =com.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
con.Close();
抱歉,我使用了错误的连接字符串
这是正确的:
"server=localhost; user id=user; password=password; database=mydatabase; pooling=false;"
谢谢奥德
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)