【发布时间】:2015-02-27 18:38:30
【问题描述】:
帮助,return dr 什么也没给我。我知道我错过了一些东西。我是这个数据集数据表的新手。请给我一些方向。谢谢
我必须初始化数据表吗?如何 ?我以为你初始化数据库时数据表已经填满了
ds as new dsPart
我在数据集查询中的表适配器如下。数据集名称为 dsPart
SELECT AttributeValue, Value, Expr2
FROM Vehicle
AttributeValue 设置为主键
Public Function getVehicleRow(ByVal iRideVehicle As Integer) As dsPart.VehicleRow
Dim ds As New dsPart
If iRideVehicle = 0 Then Return Nothing
Dim dr As dsPart.VehicleRow = ds.Vehicle.FindByAttributeValue(iRideVehicle)
Return dr
End Function
调用此函数时 irideVehicle 的值为 2132。
存在的。
车辆表的内容为:
+-----------------+--------+-------------+
|属性值 |价值 | Expr2 |
+-----------------+--------+-------------+
|第2132章本田 |新车 |
| 3214 |丰田 |新车 |
| 3546 |斯巴鲁 |新车 |
+-----------------+--------+-------------+
感谢您的帮助。
【问题讨论】:
-
您没有将任何数据填充到您的数据集中 - 因此当您调用
FindByAttributeValue(..)时您将找不到任何东西