Datatable Methods
73My Article in Ezine Articles
Datatable Methods are used for performing the operations on the runtime datatable.
AddSheet:-It is used for adding a new sheet to runtime datatable.
Syntax:-DataTable.AddSheet("Sheetname")
Example:-DataTable.AddSheet("laxmi")
DeleteSheet:-It is used for deleting a specified sheet from runtime datatable.
Syntax:-DataTable.DeleteSheet("Sheetname")
Example:-DataTable.DeleteSheet("laxmi")
Import:-It is used for importing all the sheets from Excel sheet to runtime datatable.
Syntax:-DataTable.Import"Path of Excel sheet"
Example:-DataTable.Import"d:\excel1.xls"
ImportSheet:-It is used for importing a specified sheet from Excel sheet to runtime datatable.
Syntax:-DataTable.ImportSheet"Path of Excel Sheet",Source sheetid,Destination sheetid
Example:-DataTable.ImportSheet"d:\excel2.xls",1,1
Here Source and Destination Sheet ids are 1(in this example)
1 is for Global Sheet.
Export:-It is used for exporting a complete runtime datatable(all sheets) to a specified location(path).
Syntax:-DataTable.Export"Path where excel sheet has to be created"
Example:-DataTable.Export"d:\excel3.xls"
ExportSheet:-It is used for exporting a specified sheet from a runtime datatable to specified location.
Syntax:-DataTable.ExportSheet"Path of Excel Sheet",Sheet id which has to be exported.
Example:-DataTable.ExportSheet"d:\excel4.xls",1
SetCurrentRow:-This method is used for setting the focus of QTP to a specified row.
Syntax:-DataTable.SetCurrentRow(RowNumber)
Example:-DataTable.SetCurrentRow(1)
SetPrevRow:-This method is used for setting the focus of QTP to the previous row of the currently focused row.
Syntax:-DataTable.SetPrevRow
Example:-DataTable.SetPrevRow
Check my other hub on qtp scripts
SetNextRow:-This method is used for setting the focus of QTP to the next row of the currently focused row.
Syntax:-DataTable.SetNextRow
Example:-DataTable.SetNextRow
GetSheet:-This method is used for making QTP to focus on a specified sheet.
Syntax:-DataTable.GetSheet(SheetId)
Example:-DataTable.GetSheet(1)
GetSheetCount:-This method is used to get count(number) of sheets in datatable.
Syntax:-DataTable.GetSheetCount
Example:-DataTable.GetSheetCount
GetRowCount:-This method is used for getting row count of a sheet.
Syntax:-DataTable.GetRowCount
Example:-DataTable.GetRowCount
By default it will get row count of Globalsheet.
If u want to get row count of a specified sheet then we have to use GetSheet method.
Syntax:-DataTable.GetSheet(SheetId).GetRowCount
Example:-DataTable.GetSheet(2).GetRowCount
Value:-It is used for capturing a value from a specified column,specified sheet and currently focused row.
Syntax:-DataTable.Value("column name"/column id,SheetId)
Example:-DataTable.Value("A",2) or DataTable.Value(1,2)
Hindi and Telugu Movie Songs Lyrics
QTP Script for Combo Box Control
|
7 For All Mankind Women's Straight Leg Jean in New York Dark, New York Dark, 24
Price: $155.00
List Price: $155.00 |
|
All
Price: $10.28
List Price: $16.98 |
|
7 For All Mankind Women's Boot Cut Jean with Pieced Crystal "7" in Vintage Beverly Glen, Vintage Beverly Glen, 27
Price: $235.00
List Price: $235.00 |
|
All Small & Mighty, Triple Concentrated Liquid Laundry Detergent, Nine 32-Load Bottles (288-Loads)
Price: $55.24
List Price: $58.49 |
|
All About Steve
Price: $18.99
List Price: $29.99 |
|
7 for All Mankind Men's Cluster Stripe Woven,Pewter,Medium
Price: $149.00
List Price: $149.00 |
|
Radio Flyer All-Terrain Steel and Wood Wagon
Price: $118.99
List Price: $178.49 |
|
HP IT Essentials I: PC Hardware and Software Engineering Journal and Workbook (Cisco Networking Academy Program) (2nd Edition)
Price: $2.75
List Price: $29.15 |
|
|
Cisco 3600 2-slot Modularrouter-ac with ip Software (manu In Mx
Price: $2,462.13
|
|
Comfy EasyPC Play and Learn Keyboard
Price: $79.99
|
|
Xbox RF Adapter
Price: $0.99
List Price: $19.99 |
|
SOCOM U.S. Navy Seals PSP, Software, Computers & PC hardwares, Electronics & Computers
Price: $36.25
|
|
Davis Vantage Pro2 Weather Station - Cabled Integrated Sensor Suite - NO CONSOLE - PC Connection Hardware & Software Required (Sold Separately)
Price: $269.95
List Price: $275.00 |
|
A+ JumpStart: PC Hardware and Operating Systems Basics
Price: $9.00
List Price: $24.99 |
PrintShare it! — Rate it: up down flag this hub
Comments
Hi ,
I am fetching values from database where i am storing in runtime datatable in one cloumn,
after storing this values , i need to store the another column values in the same column,now another column values are overwritng the the previous values in run time datatable,so how to set the row in run time datatable
There are 100s of free database related vidoes if someone is interested.









Prakash says:
15 months ago
Nice! Thank you