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)



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

I have written a code like

Code:
DataTable.Value("A", 1)=6

Iam getting error saying that DataTable.Value operation failed. The <A> column does not exist.

Can any body please help me to solve this

Thanks in advance


RE: Adding Value to DataTable Column - ravi.gajul - 09-13-2012

For some reason it doesn't recognize Column "A" when there is no row active.you can write some data in row "one" of data table and then click row "two" and then delete the content in row "one".The row "one" is still active after deleting the content from row "one".Now try the below code and it works as expected
Code:
DataTable.Value("A", 1)=6
Alternatively, you can use the below code without any work around
Code:
DataTable.GlobalSheet.AddParameter "A",6

Regards,
Ravi