public static MySqlDataReader GetDataFromDB(string command) using (MySqlConnection con = new MySqlConnection(ConStr))
MySqlDataReaderMySqlDataReader rdr2 = Helper.GetDataFromDB("s
我只得到1行当我运行这段代码时,我知道我有更多的行,我不知道如何很好地使用DataReader任何建议,我可以简单地计算出在数据库中的行数将不胜感激。MySqlConnection Conn = new MySqlConnection(myConnectionString); public static
我想声明一个MySqlDataReader,而不初始化它或给它赋值。就像下面的代码。MySqlDataReader rdr;
{ /* stuff to open the MySqlDataReader and use it, not important for my question因此,必须在尝试之前声明MySqlDataReader,否则它将超出最终代码的范围。然而,当我编译上面的代码时,我得到了编译时错误“使用未分配的局部变量'rdr'”,所以我想将它设置为例如
My