如何删除数据集中的列和不同的行以仅查找组名称?
我有 3 列的数据集。
Name - insurance comp. name - treatmentDate
Ali Boz SGK 12.04.09
Ali Boz SGK 14.04.09
Ali Boz SGK 16.04.09
Ali Boz SGK 18.04.09
Veli Aş AKBANK 10.04.09
Veli Aş AKBANK 11.04.09
Veli Aş AKBANK 12.04.09
Veli Aş AKBANK 13.04.09
Cuneyt Sel ING BANK 01.05.09
Cuneyt Sel ING BANK 02.05.09
Cuneyt Sel ING BANK 05.05.09
Cuneyt Sel ING BANK 19.05.09
我想首先只找到保险公司。 名称
SGK
AKBANK
ING BANK
然后我想按名称和日期排序
但是数据集中的所有这些内容(因为我想从数据库检索所有行)。
你对我有什么建议吗?
I have DataSet which has 3 columns.
Name - insurance comp. name - treatmentDate
Ali Boz SGK 12.04.09
Ali Boz SGK 14.04.09
Ali Boz SGK 16.04.09
Ali Boz SGK 18.04.09
Veli Aş AKBANK 10.04.09
Veli Aş AKBANK 11.04.09
Veli Aş AKBANK 12.04.09
Veli Aş AKBANK 13.04.09
Cuneyt Sel ING BANK 01.05.09
Cuneyt Sel ING BANK 02.05.09
Cuneyt Sel ING BANK 05.05.09
Cuneyt Sel ING BANK 19.05.09
I want to firstly find only insurance comp. names
SGK
AKBANK
ING BANK
Then i want to sort by name and date
But all those things in a DataSet (cause i want to retrive all rows from db).
Do you have any advice to me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不确定您到底要问什么,但要检索保险公司名称,您可以简单地执行以下操作:
按您提到的方式对所有记录进行排序:
Not sure what exactly your asking, but to retrieve insurance company names, you could simply execute the following:
To sort all records as you mentioned:
使用 DataView.ToTable 非常简单:
It's pretty simple using DataView.ToTable :
如果您可以使用 LINQ,这将为您提供保险公司名称:
您还可以添加
.ToArray()
或.ToList()
或orderby
如有必要,取决于您的需求。如果您无法使用 LINQ 或更改 SQL 调用,则会更加复杂< /a>.
If you can use LINQ, this will give you the insurance company names:
You could also add
.ToArray()
or.ToList()
ororderby
depending on your needs, if necessary.If you can't use LINQ or change the SQL call, it's more complicated.