Hi @ All,
I have csv file, Am trying to import data to database.
It was showing this error
Let me know anyone solved
Hi @ All,
I have csv file, Am trying to import data to database.
It was showing this error
Let me know anyone solved
Convert.toInt64(String_Variable)
try to check if there is .toInt64
Hi @wija,
I already tried If i change anything in that csv file
{File is getting corrupting}
Actually that file I downloaded from website & performing some conditions after am trying to import data to database.
hmm file corrupting, then seems it’s the file faulty
HI @varunk
try saving the csv file again to an excel file. you can do this automatically as well through the Studio.
Then, try reading data from that to see whether it works. If its a problem with the CSV file, I believe this should fix it
Let know how it goes
Hi @Lahiru.Fernando,
No here we should not change that csv to excel
It is customer format from csv only we need to get the data & import in to database.
okay… One other option is to save the CSV file again to another CSV file. Just in case to make sure the file structure is correct. Did you try that as well?
Hi @Lahiru.Fernando,
Yeah I tried this as well,same error
How about this…
So seems you changed the data type in the CSV file. Can we try this…
Int64.Parse(StringVariable)
expression to convert the value to Int64Did you try this?
Hi @Lahiru.Fernando,
I will check
Hi @Lahiru.Fernando,
Not working this also
Hi,
the datatable that you will get from csv, try to use a for loop to convert the column which you want to a type of int as suggested by wija
use a if condition ito check if the column contains integer values in it, and then convert to integer type, try this logic and let us know if this helps,
Regards,
Pavan H
To add to what @pavanh003 mentioned, you can try checking whether the data in the column can be converted to INT64 by using a TryParse command.
you can do this in a For Each Row loop.
Int64.TryParse(row("ColumnName").ToString)
Int64.TryParse(String_VariableName)
This will return either a true or a false value based on whether it is able to convert the value or not.
If True, you can then do the conversion either by using the command @wija mentioned or:
you can use Int64.Parse(VariableName)
to convert.
This will only convert if it is possible to convert. If not, it will not convert. I think this will suit you better…
Let know how it goes