質問するログイン新規登録

回答編集履歴

1

修正

2021/02/05 02:15

投稿

退会済みユーザー
answer CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  ```vb.net
4
4
  For Each row As DataRow In table0.Rows
5
- For colIndex = 1 To table0.Columns.Count - 1
5
+ For Each col As DataColumn In table0.Columns
6
- If IsDBNull(row(colIndex)) Then
6
+ If col.DataType = GetType(Decimal) AndAlso IsDBNull(row(col.Ordinal)) Then
7
- row(colIndex) = 0
7
+ row(col.Ordinal) = 0
8
8
  End If
9
9
  Next
10
10
  Next