05-02-2024 08:22 AM
Hello everyone,
I am trying to create a table in OS with the fx rates by calling an API
while calling the API, i can get the data needed but i have this error <Type 'SqlBulkCopy' is not defined.> that's doesn't allow me to copy the data in a table in OS.
this is a part of the code, the lines in orange are the ones not working.
Solved! Go to Solution.
05-02-2024 10:13 AM - edited 05-02-2024 10:13 AM
.net version changes with V8.
Use Microsoft.Data.SqlClient instead of System.Data.SqlClient;
05-02-2024 08:33 AM
Try adding
Imports System.Data.SqlClient
05-02-2024 08:35 AM
already did it's still not working 😕 , thanks for your answer
05-02-2024 09:29 AM - edited 05-02-2024 09:31 AM
The error tells us that the library for SqlBulkCopy is not in scope when running your code. The runtime cannot find the SqlBulkCopy class to use it. Thats why I suggested the import.
Consider posting the complete rule in a code block so we can see what's going on.
I wrote a rule similar to yours using SqlBulkCopy and its working for me.
05-02-2024 10:02 AM
Actually the Library seems not to be complete in th Version 8.1.0
when i try to import System.Data.SqlClient, no suggestion appears
i don't know how can this be possible 😕
05-02-2024 10:13 AM - edited 05-02-2024 10:13 AM
.net version changes with V8.
Use Microsoft.Data.SqlClient instead of System.Data.SqlClient;
05-02-2024 10:24 AM
yes it did work with Microsoft.Data.SqlClient
Thanks for your help