How To Convert The DataTable Column type?

后端 未结 3 885
半阙折子戏
半阙折子戏 2020-12-22 05:10

I am trying to implement:

dtGroupedBy.Compute(\"sum(POWER)\",dvv.RowFilter); 

It results of an error:

Invalid usage

3条回答
  •  太阳男子
    2020-12-22 05:43

    It will depend on how you've created the DataTable. If it's just straight from SQL, you should look into changing the SQL itself so that the POWER column is converted as you fetch it.

    However, if the value should always be numeric in the first place, I would strongly suggest that you revisit your database schema - it would be cleaner to change the column type if you possible can.

提交回复
热议问题