看板 C_Sharp 關於我們 聯絡資訊
※ 引述《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
Remin:非常感謝!! 140.109.40.39 07/01