多次读取一行 [英] Reading one row multiple times

查看:61
本文介绍了多次读取一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从表创建对象列表.读完表后,我检查了列表中的每个对象.  列表计数正确,但是列表中的每个对象都是相同的,表中的最后一行,所有主键都是 在列表中相同.  有人以前见过这种行为吗?我的select语句是表名中的select *.   

I'm creating an object list from a table.  After the table read has finished I inspected each object in the list.  The list count is correct, however each object in the list is the same, the last row in the table, all the primary keys are the same in the list.  Has anyone seen this behaviour before?  My select statement is select * from tablename.   

推荐答案

VS显示出一些奇怪的行为.  在断点检查对象列表时,我检查了从读取的表创建的每个对象.  每个对象都有自己的主键.读取完成后,我再次检查了第一个对象.它 它们都具有与最后一个对象相同的主键.即使我正在查看列表中的object [0],希望看到第一个对象中的数据,但我认为VS正在某种程度上显示最后一个对象中的数据.   目的.对我来说这是一个错误.  我对此行为有其他逻辑上的解释.
VS is showing some weird behaviour.  when examining a object list at a break point, I examined each object created from a table read.  Each object has its own primary key.  When the read is finished, I examined the first object again.  It has the same primary key as the last object, they all do.  Even though I'm looking at object[0] in the list<>, expecting to see the data in the first object, I think VS is somehow displaying data from the last object.  Doing this with each object.  This to me is a bug.  I'm open to any other logical explanations for this behaviour.


这篇关于多次读取一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆