Re: [問題] C#中,指定dataset.Tables.Column

看板C_Sharp (C#)作者時間20年前 (2005/07/01 02:01), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《Remin.bbs@ptt.cc (Remin)》之銘言: > 在 VB.net可以用下列程式碼,來指 dataset中的 某一table 的某一column 的名稱 > 如: -------前略----------- > Dim ds As DataSet = New DataSet() > Dim parentcol As DataColumn > Dim childcol As DataColumn > parentcol = ds.Tables("產品類別").Columns("類別編號") > childcol = ds.Tables("產品資料").Columns("類別編號") > ==>Build OK!! > 可是,當我想要改成 C# 來表示, > 如: DataSet ds = new DataSet(); > DataColumn parentcol ; > DataColumn childcol; > parentcol = ds.Tables("產品類別").Columns("類別編號"); > childcol = ds.Tables("產品資料").Columns("類別編號"); 用[]取代() ex: childcol = ds.Tables["產品資料"].Columns["類別編號"]; -- ◣ │ 我說拔辣!!◣╭─────────╮ 香蕉!!\ ◢ˋ ˋ ˊ▊ ●◤◥ ◤│ IP:140.123.174.1▂▃▅▆▇ ◤◥" ˊ " " ▋╯ ▁▃ DN:bala.twbbs.org│ ╰◢" ▂▃▄▅▆▇█ ╰─────────╯《中正資管‧芭樂的故鄉》 FR: 218-165-150-216.dynamic.hinet.net

140.109.40.39 07/01, , 1F
非常感謝!!
140.109.40.39 07/01, 1F
文章代碼(AID): #12n3Dr00 (C_Sharp)
文章代碼(AID): #12n3Dr00 (C_Sharp)