進数に変換しようとすることは、GridViewの文字列 ""から "10進数"への変換は無効です。 - VB
e.Row.Cells(i).Text = If(CType(e.Row.Cells(total).Text, Decimal) = 0, "-", (CType(e.Row.Cells(total).Text, Decimal) * 100/CType(e.Row.Cells(total).Text, Decimal)).ToString("0.00") + "%")
進数に変換しようとすることは、GridViewの文字列 ""から "10進数"への変換は無効です。 - VB
e.Row.Cells(i).Text = If(CType(e.Row.Cells(total).Text, Decimal) = 0, "-", (CType(e.Row.Cells(total).Text, Decimal) * 100/CType(e.Row.Cells(total).Text, Decimal)).ToString("0.00") + "%")
Dim temp As Decimal
temp=0
IF Decimal.TryParse(e.Row.Cells(total).Text, temp) THEN
e.Row.Cells(i).Text = If(temp = 0, "-", (temp * 100/temp).ToString("0.00") + "%")
ELSE e.Row.Cells(i).Text = "-"
"out"が動作しない –
@StavanShahの代わりに 'Decimal out 'の代わりに' temp'に切り替えるとちょっと混乱していると思います:) – Jaxi
このコードには 'End If'がありません。 –
の行のセルでエラー を与える助けてください! TXXX –
CType – N1gthm4r3
の代わりにTryCastを試してください - エラー 'TryCast'オペランドは参照型でなければなりませんが、 'Decimal'は値型です。 –