No data found, but HasRows
-
I have a problem here while excecute a oledb datareader...
... rdr.close(); //First request closed cmd.CommandText = "SELECT MID FROM MandantMC"; rdr = cmd.ExecuteReader(); if(rdr.HasRows) { strDir = rdr.GetString(0);
... rdr has rows but responsed with this message: System.InvalidOperationException: No data for row/column I don't understand this. The SQL Query analyzer give me correct results, but not this app. Before I started the Excecution of this datareader, I have closed one before ( you can see the first code line ). First request works. After closing it, the second ( the new ExcecuteReader ) fails. Maybe "cmd" make problems ? -
I have a problem here while excecute a oledb datareader...
... rdr.close(); //First request closed cmd.CommandText = "SELECT MID FROM MandantMC"; rdr = cmd.ExecuteReader(); if(rdr.HasRows) { strDir = rdr.GetString(0);
... rdr has rows but responsed with this message: System.InvalidOperationException: No data for row/column I don't understand this. The SQL Query analyzer give me correct results, but not this app. Before I started the Excecution of this datareader, I have closed one before ( you can see the first code line ). First request works. After closing it, the second ( the new ExcecuteReader ) fails. Maybe "cmd" make problems ?