string query =
"SELECT * FROM table1, table2 WHERE table1.Id = table2.fId";
...
using(IDataReader dataReader =
db.ExecuteReader(CommandType.Text, query))
..
string value = dataReader["table2.field"]; //dies
我目前正在编写一些 .NET 代码,其中涉及执行连接查询,然后使用 DataReader 访问返回的数据。我想知道是否可以使用某种前缀表示法(参见上面的示例)从返回的行中访问字段,而不必使用序数位置来访问行中的值(在两个表都包含重叠字段的情况下)名字)?