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
supriya117
(Supriya Allada)
July 20, 2023, 2:01pm
2
@ManjunathReddy
So you want to get data from config file right?
In that case:
DB_Connection = In_Config(“DBConnection”).ToString
Srini84
(Srinivas Kadamati)
July 20, 2023, 2:04pm
3
Hi @ManjunathReddy
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?
Thanks,
Srini
Parvathy
(PS Parvathy)
July 20, 2023, 2:04pm
4
Hi @ManjunathReddy
Pass in the below way in Assign activity:
DB_Connection = In_Config(DBConnection).toString
Hope it helps!!
Regards
postwick
(Paul Ostwick)
July 20, 2023, 2:12pm
5
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
Anil_G
(Anil Gorthi)
July 21, 2023, 7:31am
7
@ManjunathReddy
Try this in dbconnection field
in_Config("DBConnection").Cast(Of UIPath.DataBase.DatabaseConnection)
Cheers
It’s not working
find the reference image in the below.
Thanks
Yoichi
(Yoichi)
July 21, 2023, 7:43am
9
Hi,
How about the following?
CType(in_Config("DBConnection"),UiPath.Database.DatabaseConnection)
Regards,
Anil_G
(Anil Gorthi)
July 21, 2023, 7:48am
10
@ManjunathReddy
Try ctype(in_Config("DBConnection"),Uipath.database.Databaseconnection)
Cheers
Anil_G
(Anil Gorthi)
July 21, 2023, 7:52am
12
@ManjunathReddy
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
cheers
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.
Yoichi
(Yoichi)
July 21, 2023, 8:11am
14
Hi,
Can you try the following?
in_Config("DBConnection")
And if you need to restore it to DBConnection type , please use the following.
CType(in_Config("DBConnection"),UiPath.Database.DatabaseConnection)
OR
set DBConnection type variable
Regards,
Anil_G
(Anil Gorthi)
July 21, 2023, 8:12am
15
@ManjunathReddy
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
No change
in the process where you want to use the connection…there use the expression give above in the existing connection property
Change here
Hope this is clear
cheers
marceldro
(Marceldro)
July 21, 2023, 8:37am
16
ManjunathReddy:
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.
Hello, there is a discussion identical to yours, which was solved (DirectCast(Config(“conn”),DatabaseConnection) ) at: REFramework storing a Database connection in the Config
postwick
(Paul Ostwick)
July 21, 2023, 12:32pm
17
You don’t put it into the connection property. You put it into the Connection String property.
system
(system)
Closed
July 24, 2023, 12:33pm
18
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.