SSIS import from Excel to SQL table doesn’t like empty lines

I had a task yo import data from Excel spreadsheet to SQL Server table.
Last time I tried to use SQL Server Management Studio import option, but it gave me some not clear errors, that I didn’t understand.
So I’ve created SSIS project in VS and was able to narrow down the errors and import  the data.
This time for similar spreadsheet I had some errors again. The output contained the warnings about length of the string column, that usually can be ignored, e.g.:
Warning: 0x802092A7 at First Task, Destination – CompanyCountries [20]: Truncation may occur due to inserting data from data flow column “CountryCode” with a length of 255 to database column “CountryCode” with a length of 50.
Ideally they should be shown only when the data string actually truncated.
After a lot of information traces the errors similar the following were shown:

Error: 0xC0202009 at First Task, Destination 2 – SIPPs [144]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.

An OLE DB record is available. Source: “Microsoft SQL Native Client” Hresult: 0x80004005 Description: “Unspecified error”.

Error: 0xC020901C at First Task, Destination 2 – SIPPs [144]: There was an error with input column “HireCompanyCode” (174) on input “Destination Input” (157). The column status returned was: “The value violated the integrity constraints for the column.”.

Error: 0xC0209029 at First Task, Destination 2 – SIPPs [144]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The “input “Destination Input” (157)” failed because error code 0xC020907D occurred, and the error row disposition on “input “Destination Input” (157)” specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.

Error: 0xC0047022 at First Task, DTS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component “Destination 2 – SIPPs” (144) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.

Error: 0xC0047021 at First Task, DTS.Pipeline: SSIS Error Code DTS_E_THREADFAILED. Thread “WorkThread0” has exited with error code 0xC0209029. There may be error messages posted before this with more information on why the thread has exited.

Task failed: First Task

SSIS package “ExcelImport.dtsx” finished: Failure.

I wasn’t able to find what [144] and (157) mean- I thought, that it’s lines in  the data input, but I didn’t find issues with particular rows.
I had to remove all constraints and “not null” restrictions from the target SQL table before the import was successful.
When I analyzed imorted data, I understood, that Excel had empty rows at the end, that were tried to import as null values.
I’ve deleted null records and used sp_generate_inserts to create SQL script for production.
By the way, when I included SSIS solution to TFS source control, the file Integration Services Project1.database was included. Previously I renamed the solution and project to the meaningful name, but this file wasn’t renamed. Do I need it at all? Can I rename it?

“Edit and continue” not working in functions with LINQ

I’ve started to use LINQ and feel that query expression are very powerfull.
Unfortunately , when in debugger I’ve tried to  Edit and continue, it gave me an error
Modifying a ‘method’ which contains a query expression will prevent the debug session from continuing while Edit and Continue is enabled. 
The post Orcas – Edit and continued not working when linq used – MSDN Forums explains that “it is a limitation of the environment in which Edit and Continue operates”.
I’ve submitted suggession to MS – please vote to push MS to improve  E&C support.
Sometimes I feel, that E&C in VB6 was better.
As a workaround I will try not to keep LINQ queries inside big function, but refactor them into small functions. Unfortunately it makes Language-INtegrated Queries not so-good in integration with language.
By the way I am using refactoring from VS and Refactor! for ASP.NET , and extract function works better from VS; Refactor! not always correctly declares parameters.

Function to Convert ASP.NET bool to JavaScript bool.

I was generating some JavaScript in the server code and found that bool.ToString() doesn’t create string that JavaScript expects as boolean- .Net uses first letter as capital True/False. Then I found in my own class, that I’ve wrote helper function a long time ago:

public static string JSToString(bool bValue)


                  return bValue.ToString().ToLower();