oracle读取datatable bool栏位,如何获取DataTable中的值

我用New-Object System.Data.DataTable创建了一个$dt,然后调用Oracle.DataAccess将表的值填充到$dt中。

一下是输入$dt后的内容。

TIMESTAMP  : 2015/3/25 23:25:37

CARNUM     : 809

DATANUM    : 25994

NEWCARNUM  : 0

NEWDATANUM : 0

现在我想将表中某一项的值赋给其他变量,如NEWDATANUM的值,请问需要如何操作。

我之前设想的是使用$dt.NEWDATANUM,但是得到的是空值。

PS :\> $dt.gettype()

IsPublic IsSerial Name                                     BaseType

——– ——– —-                                     ——–

True     True     DataTable                                System.ComponentModel.MarshalByValueComponent

PS :\> $dt | get-member

TypeName: System.Data.DataRow

Name              MemberType            Definition

—-              ———-            ———-

AcceptChanges     Method                System.Void AcceptChanges()

BeginEdit         Method                System.Void BeginEdit()

CancelEdit        Method                System.Void CancelEdit()

ClearErrors       Method                System.Void ClearErrors()

Delete            Method                System.Void Delete()

EndEdit           Method                System.Void EndEdit()

Equals            Method                bool Equals(System.Object obj)

GetChildRows      Method                System.Data.DataRow[] GetChildRows(string relationName), System.Data.DataRow…

GetColumnError    Method                string GetColumnError(int columnIndex), string GetColumnError(string columnN…

GetColumnsInError Method                System.Data.DataColumn[] GetColumnsInError()

GetHashCode       Method                int GetHashCode()

GetParentRow      Method                System.Data.DataRow GetParentRow(string relationName), System.Data.DataRow G…

GetParentRows     Method                System.Data.DataRow[] GetParentRows(string relationName), System.Data.DataRo…

GetType           Method                type GetType()

HasVersion        Method                bool HasVersion(System.Data.DataRowVersion version)

IsNull            Method                bool IsNull(int columnIndex), bool IsNull(string columnName), bool IsNull(Sy…

RejectChanges     Method                System.Void RejectChanges()

SetAdded          Method                System.Void SetAdded()

SetColumnError    Method                System.Void SetColumnError(int columnIndex, string error), System.Void SetCo…

SetModified       Method                System.Void SetModified()

SetParentRow      Method                System.Void SetParentRow(System.Data.DataRow parentRow), System.Void SetPare…

ToString          Method                string ToString()

Item              ParameterizedProperty System.Object Item(int columnIndex) {get;set;}, System.Object Item(string co…

CARNUM            Property              System.Decimal CARNUM {get;set;}

DATANUM           Property              System.Decimal DATANUM {get;set;}

NEWCARNUM         Property              System.Decimal NEWCARNUM {get;set;}

NEWDATANUM        Property              System.Decimal NEWDATANUM {get;set;}

TIMESTAMP         Property              System.DateTime TIMESTAMP {get;set;}

×用微信扫描并分享

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值