Has anyone encountered an error that states the row declared has already been disposed and cannot be manipulated? How do I resolve this error? Thanks for your help!
Here is my code below:
...
QueryFilter qf = new QueryFilter
{
WhereClause = CokeysWhereClause,
};
using (var rowCursor = HzTable.Search(qf))
{
while (rowCursor.MoveNext())
{
foreach (var compPct in compPcts)
{
using (Row row = rowCursor.Current)
{
var topHz = Convert.ToInt32(row["hzdept_r"]); // disposed error occurs in the second loop
var bottomHz = Convert.ToInt32(row["hzdepb_r"]);
...
Thanks!
Hi,
I think you must change two cycles by places:
using (Row row = rowCursor.Current)
{
var topHz = Convert.ToInt32(row["hzdept_r"]);
var bottomHz = Convert.ToInt32(row["hzdepb_r"]);
foreach (var compPct in compPcts)
{
rowCursor.Current can be read once.