Hello Nisha,
The below code snippet it might help you. By the way which DB you are using,Is it SQL Server 2008/2005 or Oracle 10g/11
Function DatabaseConnection()
{
//create ADO connection and Record set objects
objConnection = Sys.OleObject("ADODB.Connection");
objRecordset = Sys.OleObject("ADODB.Recordset");
param_record_set = Sys.OleObject("ADODB.Recordset");
var connectionString = "Data Source=PCACODBS08;Initial Catalog=DatabaseName;User ID=TestComplete;Password=testcomplete;Provider=SQLOLEDB ";//Setup the connection parameters // Catalog=DatabaseName-->This is the name of DB, you will get on DB Server
objConnection.Open(connectionString);
objRecordset.Open("Select Top 3 * from dbo.Main_Table where TC_HOST= 'TC_HOST' and in_use = 0 and is_active = 1", objConnection,adOpenStatic, adLockOptimistic,adCmdText);
--------------;
}
Regards,
Kumar