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



How to get the column count and column name from the resultset in the database connection pro..

Answer / ram

you use following sql query

select column name, count(column name)from table name.

Is This Answer Correct ?    3 Yes 3 No

How to get the column count and column name from the resultset in the database connection pro..

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

How to get the column count and column name from the resultset in the database connection pro..

Answer / mahesh

select count(column name) column name from the table.

Is This Answer Correct ?    1 Yes 2 No

How to get the column count and column name from the resultset in the database connection pro..

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

How to get the column count and column name from the resultset in the database connection pro..

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

Post New Answer

More QTP Interview Questions

How can we use XML in QTP?

1 Answers  


In QTP I have a parameter in a datatable that is a sentence. I need to take the last word from the sentence and enter it into a field in a web application. How can I setup a parameter to enter in just a portion of the parameter (last word of the sentence) instead of the entire paramater (whole sentence).

2 Answers  


Explain Different types of Checkpoints in Quick Test Professional?

2 Answers   Crea,


How Does Run time data (Parameterization) is handled in QTP?

4 Answers   IBM,


How to modify object property in qtp ?

0 Answers  






When u ll use Record Button in QTP?Is VB script is Mandatory in QTP? What is Meaning of Frame("v1")?

1 Answers   TCS,


What is an environment variable?

1 Answers  


Through array we can execute the testcase how ? give me example

0 Answers   TCS,


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

0 Answers  


How does QTP identifes the object in the application?

1 Answers  


What are the ordinal identifiers in web page?

0 Answers  


What is Modular framework and Keyword drive framework? Explain

4 Answers  


Categories