如何恢复其余行?嗨!谢谢!I tried to recover the info using something like: Console.WriteLine(myReader.GetString(0,0)); //or: Console.WriteLine(myReader[0,0]); Console.WriteLine(myReader[0][0]);But it doesn''t work :(( How can I recover the rest of rows? HEEEELP! and Thanks!推荐答案 myReader.Read精确读取一行,然后您可以访问列与myReader[0]和myReader[1]一起使用,因为只有两列您不能做myreader [2],因为那样会尝试读取您已经说过的不存在的第三列.只要结果中还剩下行,myReader.Read()(请参见while语句)将返回true.因此,在循环的每次执行中,您都只能处理一行.希望对您有所帮助! :) 最好的问候,曼弗雷德(Manfred)myReader.Readreads exactly one row and then you can access the columnswith myReader[0] and myReader[1] because there are only two columns you cant do myreader[2] as that would try to read the third columns which as you already stated doesn''t exist.As long as there are rows left in your result the myReader.Read() (see your while statement) will return true. So in every execution of your loop you''re able to process exactly one line.Hope that helps! :) Best regards,Manfred 这篇关于从MySql到C#数组的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 19:12