How to pass dynamic values in to connection string in Oracle DB

Hi Team,

I am able to pass the values for User id and password however unable to pass the values for other parameters like Host , Port and Service Name…

Please suggest

Connection String:

“USER ID='”+USER_ID+“‘;PASSWORD=’”+PASSWORD+“';DATA SOURCE=”(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxx)(PORT =xxxx)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = xxxxxxx)))“”

Note : Getting the values from a Data Table

You do it the same way…

“USER ID=‘”+USER_ID+“‘;PASSWORD=’”+PASSWORD+“’;DATA SOURCE=”(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ‘" + hostVar + "’)(PORT =‘" + portVar + "’)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ‘" + serverVar + "’)))“

If you’re looping through a datatable then just reference it the way you normally reference row data ie CurrentRow(“columnName”).ToString