Micro Focus QTP (UFT) Forums
DataTable Issue - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: DataTable Issue (/Thread-DataTable-Issue)



DataTable Issue - VineethRPillai - 08-06-2010

Hi Friends,

I have to do a data validation of an excel file. I imported the excel into QTP and I pull one value after another for checking the data.

The problem I am facing is that, the value which I pull from Datatable is picked as a string. Debugger shows the value in " ". If I use a TypeName function, it returns STRING always, even though the data is numeric..How can I handle this scenario??

Thanks in AdvanceSmile


RE: DataTable Issue - venkatbatchu - 08-06-2010

Hi,

U could use CINT(Datatable.Value("Paramaeter ID",Sheet ID")

Venkat.Batchu


RE: DataTable Issue - VineethRPillai - 08-06-2010

But if the value coming in is a string, then CINT will throw an error...


RE: DataTable Issue - venkatbatchu - 08-06-2010

If you are not familiar about the data type you are comparing then please pass the Cstr(Target) and Cstr(Source)

Please convert both target and source as strings then u will not face any issue.

Try with this, it will work.


Venkat.Batchu


RE: DataTable Issue - VineethRPillai - 08-06-2010

Thanks Venkat...

The Real Scenario is diff.

Eg: I have a column in Datatable which is supposed 2 have only NUMBERS. (1000,1001...). Since I am picking the value frm DT, QTP picks it as "1000". And when I do a TypeName, it returns String although it is a number..

In general, any data(whether it is a NUMBER,STRING,DATE etc) that you pick up from DT will be returned as a STRING if I use TypeName. Sad