Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DataTable Issue
#1
Solved: 11 Years, 4 Months ago
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
Reply
#2
Solved: 11 Years, 4 Months ago
Hi,

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

Venkat.Batchu
Reply
#3
Solved: 11 Years, 4 Months ago
But if the value coming in is a string, then CINT will throw an error...
Reply
#4
Solved: 11 Years, 4 Months ago
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
Reply
#5
Solved: 11 Years, 4 Months ago Sad 
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Datatable add and datatable import sheet wheelercha 4 33,634 06-14-2012, 04:53 PM
Last Post: Arul
  DataTable Local Sheet Identification Issue Kiran28 2 4,240 07-13-2011, 07:46 AM
Last Post: rajpes
  QTP - DataTable Issue ssherman84 1 2,497 01-04-2011, 08:48 AM
Last Post: rajeshwar

Forum Jump:


Users browsing this thread: 3 Guest(s)