adding a new column to dataset which stores log values of another table
-
Hi, I am using dataset for playing with data and wanted to create an additional column that stores logarithm (log) of another column. I tried to use number of options including the one below but still have trouble making the program work. dtRec.Columns.Add("sumXY", Type.GetType("System.Double"), Math.Log("recflow")) recflow is an existing column of the dataset and I want log values of reflow to be stored in new sumXY column. Any suggestions!! Amanjot
-
Hi, I am using dataset for playing with data and wanted to create an additional column that stores logarithm (log) of another column. I tried to use number of options including the one below but still have trouble making the program work. dtRec.Columns.Add("sumXY", Type.GetType("System.Double"), Math.Log("recflow")) recflow is an existing column of the dataset and I want log values of reflow to be stored in new sumXY column. Any suggestions!! Amanjot
Amanjot, The way you've written the third parameter is, I think, incorrect. This might work instead:
tRec.Columns.Add("sumXY", Type.GetType("System.Double"), "Math.Log(recflow)")
Steve Erbach Neenah, WI http://TheTownCrank.blogspot.com -
Amanjot, The way you've written the third parameter is, I think, incorrect. This might work instead:
tRec.Columns.Add("sumXY", Type.GetType("System.Double"), "Math.Log(recflow)")
Steve Erbach Neenah, WI http://TheTownCrank.blogspot.com