How to get the column count and column name from the
resultset in the database connection program?
Answers were Sorted based on User's Feedback
Answer / ram
you use following sql query
select column name, count(column name)from table name.
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / tvsrkc
we can get the column count by following code
------------------------------------------------
set colcoll=rs.fields
colcnt=colcoll.count
for i=0 to colcnt-1
msgbox rs.fields(i).name
rs.movenext
next
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / mahesh
select count(column name) column name from the table.
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / nageshbijoor@gmail.com
you can get column count using following code
totalrec = 0
DataTable datatable
datatable = ds.Tables["tablename"]
totalrec = datatable.Rows.Count
Label1.Text = datatable.Rows[currrec]["columnname"].ToString
()
| Is This Answer Correct ? | 3 Yes | 4 No |
Answer / krishnat.qa
we can get the column count by following code
-----------------------------------------------------
set colcoll=rs.fields
colcnt=colcoll.count
for i=0 to colcnt-1
msgbox rs.fields(i).name
rs.movenext
next
| Is This Answer Correct ? | 1 Yes | 3 No |
What is parameterization? What is syncronization pt.?
3 Answers Semantic Space, SRM,
What is exact meaning of Database Checkpoint in QTP 9.2 and what are the different types of the database check points?
What is the difference between Call to Action and Copy Action.?
How to capture screen shots when an error occurs?
why we use environment variables
what is the use of automation objective model?where is used? plz tell me
how to insert QTP to display errors and other description in the test results instead of halting execution by throwing error in the mid of executin due to an error (for object not found)?
give me the code for check point for validating application
wt is automation framework? give explonation?
how u test a frame in a web page using QTP?
What is difference between design time and run time data table?
what is the Command used to start the QTp from Run.