Micro Focus QTP (UFT) Forums
Adding Value to DataTable Column - 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: Adding Value to DataTable Column (/Thread-Adding-Value-to-DataTable-Column--6787)



Adding Value to DataTable Column - kriday - 09-13-2012

Hi I have written like this
Code:
DataTable.Value "A", 1 = 6
but it is giving error like DataTable.Value operation failed. <A> does not exist.
Can any body please help me on this
Thanks in advance


RE: Adding Value to DataTable Column - SIBICA - 09-13-2012

Hi kriday,
Correct syntax for using value property is
DataTable.Value (ParameterID[,SheetID])
--It retrieves or sets the value of the cell in the specified parameer and the current row of the run-time data table.

Ex: DataTable.Value ("ColumnName","Global")
Here, ColoumnName is the name of the column in data table
and Global is the sheet name.

Hope it vl work....!

Regards,
Sibi C A


RE: Adding Value to DataTable Column - kriday - 09-14-2012

Hi

I tried the same thing
(i.e DataTable.Value("A", "Global")=6)
getting same error. Is there any way to add value to datatable

Thanks in advance
Kriday


RE: Adding Value to DataTable Column - SIBICA - 09-14-2012

Hi,

For me, DataTable.Value("A", "Global")=6 is working fine...
what error you are getting?
Did you create any column with column name "A"? If not just create one and run the above code.Then you won't get that error again.Because by default in datatable first column name is "A".

Reagards,
Sibi C A