ianinspain
asked on
500pts: Extracting data from a table object?
Hi..
Can anyone help, I seem to be having a problem getting data from a table.. I have a table and if i do
? myData.Table.Rows.Count
I get 1, so data is there...
I have tried various things like
I tried myData.Table.Columns["TOTA L"]
but there is no property VALUE for example...
Can anyone suggest what i am doing wrong?
Thanks in advance
Ian
Can anyone help, I seem to be having a problem getting data from a table.. I have a table and if i do
? myData.Table.Rows.Count
I get 1, so data is there...
I have tried various things like
I tried myData.Table.Columns["TOTA
but there is no property VALUE for example...
Can anyone suggest what i am doing wrong?
Thanks in advance
Ian
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks gauthampj,
That sort of works.. I get this
? myData.Table.Rows[0]["BO"]
{130.1}
System.ValueType: {System.Double}
Epsilon: 4.94065645841247E-324
m_value: 130.1
MaxValue: 1.7976931348623157E+308
MinValue: -1.7976931348623157E+308
NaN: NaN
NegativeInfinity: -Infinity
PositiveInfinity: +Infinity
But i really need just the value, i did try ToString but that didn't give the details either...
That sort of works.. I get this
? myData.Table.Rows[0]["BO"]
{130.1}
System.ValueType: {System.Double}
Epsilon: 4.94065645841247E-324
m_value: 130.1
MaxValue: 1.7976931348623157E+308
MinValue: -1.7976931348623157E+308
NaN: NaN
NegativeInfinity: -Infinity
PositiveInfinity: +Infinity
But i really need just the value, i did try ToString but that didn't give the details either...
myData.Table.Rows[0][0].To String(), this should give you the first value in the first column
If it has value then , I think there may not be any column named "TOTAL"
If it has value then , I think there may not be any column named "TOTAL"
ASKER
No it works... but doing ToString doesn't give me the value..
U mean myData.Table.Rows[0][0] has value, but
myData.Table.Rows[0][0].To String() throws error, rite?
myData.Table.Rows[0][0].To
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks BBK, yes i did try this... here is what i get.... If the column is a string then no probs.... But my column is a Double
? response.Data.Tables[0].Ro ws[0][1]
{0.0}
System.ValueType: {System.Double}
Epsilon: 4.94065645841247E-324
m_value: 0.0
MaxValue: 1.7976931348623157E+308
MinValue: -1.7976931348623157E+308
NaN: NaN
NegativeInfinity: -Infinity
PositiveInfinity: +Infinity
? response.Data.Tables[0].Ro ws[0][1].T oString
<overloaded>
ToString: ((System.Double)((response .Data.Tabl es[0].Rows [0].get_It em(1)))).T oString+0 // method+offset
ToString: ((System.Double)((response .Data.Tabl es[0].Rows [0].get_It em(1)))).T oString+0 // method+offset
ToString: ((System.Double)((response .Data.Tabl es[0].Rows [0].get_It em(1)))).T oString+0 // method+offset
ToString: ((System.Double)((response .Data.Tabl es[0].Rows [0].get_It em(1)))).T oString+0 // method+offset
? response.Data.Tables[0].Ro
{0.0}
System.ValueType: {System.Double}
Epsilon: 4.94065645841247E-324
m_value: 0.0
MaxValue: 1.7976931348623157E+308
MinValue: -1.7976931348623157E+308
NaN: NaN
NegativeInfinity: -Infinity
PositiveInfinity: +Infinity
? response.Data.Tables[0].Ro
<overloaded>
ToString: ((System.Double)((response
ToString: ((System.Double)((response
ToString: ((System.Double)((response
ToString: ((System.Double)((response
ASKER
ahh .. thnaks.. I got it
Double.Parse( response.Data.Tables[0].Ro ws[0][1].T oString())
Double.Parse( response.Data.Tables[0].Ro
what object is myData : DataTable, DataTableCollection?
Apresto