Wednesday, January 21, 2009

Methods for Retrive Data from DB Query result

Number of Columns in DB Query Results :-
Column count= Fields.Count

Number of in DB Query Results :-
Record/Row count= RecordSet.recordcount

Get the Column value from a particualr Record :-
value= RecordSet.Fields(Index of the Column).Value

How to confirm DB (Database) connection is successfully connected?
Return value= RecordSetObjectName.State
0-- Zero represents for NOT connected successfull
1-- One represents for Successfull connection.

Sometimes Data base columns we have cast for capture values. we can do same with below query.

Select Cast(filed name as nVarchar(3000)) from table name where condition

No comments:

Post a Comment