【发布时间】:2010-02-01 11:33:36
【问题描述】:
我在使用“ADO.NET Driver for MySQL (Connector/NET)”连接到 mysql 数据库时遇到问题
我收到了这个异常The given key was not present in the dictionary.
编辑:
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();
【问题讨论】:
-
贴出抛出异常的代码。
-
发布完整的异常堆栈跟踪也可能会有所帮助。
标签: asp.net mysql connection-string