[.NET] Unable to cast object of type
請問我已經拉了datarepeater與bindingnagivator到表單上,並指定了bindingsource,
我現在希望能由程式控制datarepeater內text文字格的預設值
所以我參考了以下網址、1樓的回文
http://0rz.tw/vNaoq
但當我實際測試跑程式的時候,程式會停在下面這一行
Dim Table As DataTable = DirectCast(Me.myBindingSource.DataSource, DataTable)
並且出現以下的錯誤訊息:
"Unable to cast object of type 'PICData.PICSettingDataSet' to type
'System.Data.DataTable'
請問為什麼datasource也是table卻不能轉換成datatable?
該怎麼改才是對的呢?謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.248.17.41
→
01/12 20:01, , 1F
01/12 20:01, 1F
→
01/13 09:07, , 2F
01/13 09:07, 2F
→
01/14 14:36, , 3F
01/14 14:36, 3F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):