如何在数据行中访问具有相同名称的列 [英] How to access columns having same name in a datarow

查看:71
本文介绍了如何在数据行中访问具有相同名称的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我知道这看起来可能看起来很奇怪,但我通过使用不同的表创建的

数据集循环。这两个表有一些名称相同的字段。


现在我想使用datarow中的那些列。我怎样才能确切地获得

同一列我不想在

datarow中存在重复的一个?


如果你了解它请回复我。


提前致谢,

Vish

解决方案

Vish,


为什么不在Select语句中使用别名来从

数据库中检索数据?
< br $>
Kerry Moorman

" vish"写道:


大家好,


我知道这看起来可能看起来很奇怪,但我正在通过

使用不同的表创建数据集

来自数据库。这两个表有一些具有相同名称的字段。


现在我想要使用datarow中的那些列。我怎样才能确切地获得

同一列我不想在

datarow中存在重复的一个?


如果你了解它请回复我。


提前致谢,

Vish

谢谢Kerry,


但实际上要求是我不能在选择语句中使用

中的别名。因为我想在代码块中使用两个列(具有

同名)用于不同目的。


它是否仍然可以在程序员世界中使用?


非常感谢您的回复。


Vish


< blockquote>是的,我在你发布的另一个新闻组中发布了这个问题的答案

这个问题。


Robin S.

Ts''i mahnu uterna ot twan ot geifur hingts uto。

---------------------------- -------------------

" vish" < vr ********* @ gmail.comwrote in message

news:11 ********************* *@l53g2000cwa.googlegr oups.com ...


谢谢Kerry,


但实际上要求是这样的,我不能使用

中的别名select语句。因为我想在代码块中使用两个列(具有

同名)用于不同目的。


它是否仍然可以在程序员世界中使用?


非常感谢您的回复。


Vish



Hi all,

I know this might look strange at first look, but i am looping thru a
dataset created using to different tables
from database.These two tables have some fields with the same names.

Now i want to use those columns from datarow. How can i get exactly
the same column i want not the othere duplicate one residing in the
datarow?

If you understand it pls reply me.

Thanks in advance,
Vish

解决方案

Vish,

Why not use an alias in the Select statement that retrieves the data from
the database?

Kerry Moorman
"vish" wrote:

Hi all,

I know this might look strange at first look, but i am looping thru a
dataset created using to different tables
from database.These two tables have some fields with the same names.

Now i want to use those columns from datarow. How can i get exactly
the same column i want not the othere duplicate one residing in the
datarow?

If you understand it pls reply me.

Thanks in advance,
Vish


Thanks Kerry,

But actually the requirement is such that i can not use the alias in
the select statement. As i want to use both columns ( that are with
same name ) for different purpose in a code block.

Is it still possible in the programmers world?

Thanks very much for your reply.

Vish


Yes, I posted the answer to this in the other newsgroup where you posted
this question.

Robin S.
Ts''i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"vish" <vr*********@gmail.comwrote in message
news:11**********************@l53g2000cwa.googlegr oups.com...

Thanks Kerry,

But actually the requirement is such that i can not use the alias in
the select statement. As i want to use both columns ( that are with
same name ) for different purpose in a code block.

Is it still possible in the programmers world?

Thanks very much for your reply.

Vish



这篇关于如何在数据行中访问具有相同名称的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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