Thursday, June 25, 2009

Index and length must refer to a location within the string. Parameter name: length (mscorlib)

While importing Data from Excel 2007 (a .xlsx file)

I came across following error

Index and length must refer to a location within the string.
Parameter name: length (mscorlib)

I was able to read meta data of excel but could not read the Data.

I was able to read data by copying over the same data to new Excel sheet and reading from there....This show me that excel's Internal database got infected in some manor.

while I am trying to find a better solution above work arround can be used.

Tuesday, June 2, 2009

Xcopy

xcopy "C:\Documents and Settings\t_AbhishekJ\My Documents\Citirx\CreateDDL" "v:\My Documents\SQLScripts" /s /y


Options
/A - Copies only files that have been set as archive files (using the ATTRIB command). The copied files will still be marked as archive files in BOTH the source and destination files.

/D:(date) - Copies only those files in the source directory that have been changed on or LATER than the specified date.

/S - Copies all files in the current directory and in any subdirectory within it.

/E - Copies subdirectories, even if they are empty. If you use this option, you must use the /S option also.

/M - Copies the same marked archive files as specified in the /A option; however, the files on the destination disk are no longer marked as archive files. This switch checks the archive attribute of a file: if the file`s archive attribute is set to off (-A), the file will not be copied.

/P - Does not copy the file until you respond to a prompt that asks you to confirm that you want the file copied. However, if you are using the /E option, you will not be prompted before an empty subdirectory is copied.

/V - Each file copied is verified to be sure the file stored on the destination disk is identical to the original on the source disk.

/W - Copies only after you respond to a prompt to begin copying (if this option is omitted, the copying begins as soon as you enter the XCOPY command and press the Enter key).

/Y - Causes XCOPY to replace existing files without a confirmation prompt.

/-Y - Causes XCOPY to give you a confirmation prompt before replacing an existing file.