I have one Excel file there are some columns that do not have any value.I want to insert the data into SQL when I run the workflow it shows I cannot find column 21. This error occurs because column no 21 is empty.
yes.it exists
Can you please attach a screenshot here of datatable with 21st column
The number of columns are 21, but the index of first column is 0 and last column is 20, so to access the last column you need to put 20 instead of 21, while entering the value to database.
thanks. yes when I shared the image then I realized this
Please use log message and print the sql statement so that we can see what the syntax error is
Cheers
Either connection string is wrong
if that is not true then please try changing the database package version and check mostly 1.6 works
cheers
Hi @Cuberoot
Iterate through the columns of the DataTable using a For Each activity. Set the TypeArgument property of the For Each activity to System.Data.DataColumn.
Within the loop, check if the column is empty using an If activity. You can use the IsNullOrWhiteSpace method to check if the column is empty.
Example-
The Condition to check if a column at index 20 (column number 21) is empty:-
String.IsNullOrWhiteSpace(row.Item(20).ToString)
Thanks!!
how to install data providers
is it suitable for oracle ?
For oracle can use this…check the compatibility depending on version youa re using
Cheers
Should I download both ?
You can download any one …one is odbc drivers and other is oledb drivers…anything can be used…the connection string should be created accordingly using the installed driver
Cheers