在使用DataAdapter时报错:“Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information.”(不返回任何键列信息的SelectCommand不支持UpdateCommand的动态SQL生成)
运行代码如下:
string connstr = "server=localhost;user id=root;password=******;database=mydb";
MySqlConnection myconn = new MySqlConnection();
myconn.ConnectionString = connstr;
myconn.Open();
string myselect = "select * from mydb.student";
MySqlCommand mycmd = new MySqlCommand();
mycmd.Connection = myconn;
mycmd.CommandText = myselect;
DataSet myds = new DataSet();
MySqlDataAdapter myada = new MySqlDataAdapter(myselect, myconn);
myconn.Close();
m