DB connection has been given in InItAllApplication, so i need add that connection Variable to Config file. Then I need to give that connection name into run query activity.
Getting below error, Please let me know how to resolve.
I tried this way.
In_Config(DBConnection) = DB_Connection
Thanks in advance
So you want to get data from config file right?
In that case:
DB_Connection = In_Config(“DBConnection”).ToString
Before passing to the DatabaseConnection can you put writeline activity and check if you are getting the desired value?
If not then you need to check the passing of the In_Config correctly?
Pass in the below way in Assign activity:
DB_Connection = In_Config(DBConnection).toString
Hope it helps!!
You can’t. You can put the connection string in the config file and pass that into the Connect to Database activity.
@supriya117 I tried it didn’t workout you can see below image
@Srini84 Yes I have printed
It is printing like “UiPath.Database.DatabaseConnection”
@postwick I tried to apply through config but no use.
Thanks for replaying
@uipath @Anil_G @Yoichi @Gokul001 @Gokul_Jayakumar @supermanPunch
Try this in dbconnection field
It’s not working
find the reference image in the below.
How about the following?
Where are you using this…this has to be used in the place where you are trying to use the connection and not in connect to database activity
in connect to database just give the variable…and when using in existingconnection field use as specified above
Like below this is in Init state from here I need to tack the connection Name & I have to use in process state where I am executing the query.
Can you try the following?
And if you need to restore it to DBConnection type , please use the following.
set DBConnection type variable
in this init application just add the variable as you previously added…and the assign of DBconnection to in_config(“DbConnection”) also will still be there
in the process where you want to use the connection…there use the expression give above in the existing connection property
Hope this is clear
Hello, there is a discussion identical to yours, which was solved (DirectCast(Config(“conn”),DatabaseConnection) ) at: REFramework storing a Database connection in the Config
You don’t put it into the connection property. You put it into the Connection String property.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.