Sunday, February 22, 2009

Get Column Count,Col names of DataTable

HI All,
Here i am posting the ways of retreiving the column count & column names used in datasheets of datatable.
Implement the given ways accordingly........Have a Nice day.

'**************************************
To Retrieve the Column count Data Table :
'**************************************
Syntax :
Col_count= Datatable.GetSheet("SheetName").GetParameterCount
Example1:
Col_count= Datatable.GetSheet("Action1").GetParameterCount
msgbox "No. of columns used in "&Environment("ActionName")&" are : " &Col_count
'*****************************************
To Retrieve the Column Names of Data Table :
'*****************************************
Syntax :
Datatable.GetSheet("SheetName").GetParameter(Column Number).Name
Example1 :
Col_Name=Datatable.GetSheet("Action1").GetParameter(1).Name
msgbox " Column name is : "&Col_Name

2 comments: