in Education by
I have added external dll files in the script task. The code is working when I am debugging the script task but the code is not working when I execute SSIS package directly without debugging. So I am getting exception has been thrown by the target of an invocation. ssis error in this. Can anyone have solution on this problem. I have registered the dll's in GAC and restarted the machine. But still it is giving me this error JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I had a difficult time finding a solution to this issue (the issue with no solution has been posted here at least a couple of times). It has to do with the VFP OLEDB data provider blowing up in .NET when reading certain DBFs. Apparently, the issue stems from the way VFP allows you to take digits from the right side of the decimal point and use them on the left side. For example if the column is defined as N(5,3) it should only hold numbers up to 9.999, but if you don't need all three decimal places on the right side of the decimal point, you can use the space left over for digits on the left side. So this column will hold 999.9! In any case, it throws an InvalidOperationException. This prevents you from using a DataAdapter's Fill() method to read the data. The work-around, is to use a data reader, build a DataTable from scratch and populate each column, one at a time in each row. When the exception occurs, insert null for the value. Here's some C# 2.0 code: public DataTable GetVfpDataTable(string dbfFullPath) { string sqlString = "SELECT * FROM " + Path.GetFileName(dbfFullPath); OleDbConnection oleConn = new OleDbConnection("Provider=VFPOLEDB.1;Data Source=" + Path.GetDirectoryName(dbfFullPath) + ";Collating Sequence=MACHINE;"); OleDbCommand oleCmd = new OleDbCommand(sqlString, oleConn); OleDbDataReader oleReader; DataColumn col; DataRow row; DataTable dbfTable = new DataTable(); try { oleConn.Open(); //Bug in VFP OLE Data Adapter blows up with error // "The provider could not determine the decimal value..." // must read with a data reader row by row, column by column oleReader = oleCmd.ExecuteReader(); for (int i = 0; i < oleReader.FieldCount; i++) { col = new DataColumn(oleReader.GetName(i), oleReader.GetFieldType(i)); dbfTable.Columns.Add(col); } while (oleReader.Read()) { row = dbfTable.NewRow(); for (int i = 0; i < oleReader.FieldCount; i++) { try { row[i] = oleReader[i]; } catch (InvalidOperationException) { row[i] = DBNull.Value; //work-around for VFP OLEDB Provider glitch } } dbfTable.Rows.Add(row); } } catch (Exception eX) { throw new FileLoadException("Error Importing From VFP File\n" + eX.Message + "\nVFPDataAccess.cs:GetVfpDataTable()", dbfFullPath); } finally { oleConn.Close(); } return dbfTable; }

Related questions

0 votes
    I have added external dll files in the script task. The code is working when I am debugging the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    Which of these operator is used to generate an instance of an exception than can be thrown by using throw? ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these keywords must be used to handle the exception thrown by try block in some rational manner? (a ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following keyword is used by calling function to handle exception thrown by called function? (a) ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following operators is used to generate instance of an exception which can be thrown using throw? (a ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these keywords is used to generate an exception explicitly? (a) try (b) finally (c) throw (d) ... Exception Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these keywords are used for generating an exception manually? (a) try (b) catch (c) throw (d) ... Exception Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods return description of an exception? (a) getException() (b) getMessage() (c) ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods return localized description of an exception? (a) getLocalizedMessage() (b) getMessage() (c ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    I want to raise an exception in Python and in future want to detect it using an except block, Can someone tell me how to do it? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Which of the following should be true of the object thrown by a thrown statement? (a) Should be assignable ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    I recently installed groovy. C:\Users\Shivendra Gupta>groovy -v WARNING: An illegal reflective access operation ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    Which of these keywords is not a part of exception handling? (a) try (b) finally (c) thrown (d) ... Exception Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following keywords is used for throwing exception manually? (a) finally (b) try (c) throw ( ... Exception Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following is a super class of all exception type classes? (a) Catchable (b) RuntimeExceptions (c ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
...