Hi,
I am working on uploading the csv file and saving the data into database. I have done with saving part but what i need is to validate the csv with correct data farmat.
-----------------------------------------------
Name Address Age Gender
---------------------------------------------
a Hyderabad 23 M
b Banglore 25 F
c Mumbai 26 M
---------------------------------------------
The Data In csv file need to be In above format while upload. If they enter data in below format and trying to upload it then an error message need to be display saying "Upload Valid CSV File".
-----------------------------------------------
Name Address (Column Name Is missing) Gender| Column0
--------------------------------------------
a Hyderabad 23 M | ( Some Junk Data)
b Banglore 25 F |
c Mumbai 26 M |
--------------------------------------------- --------------------------------------------
Xyz olp
-------------------------------------------
I have googled a lot but did not found valid links which suits for my problem.


Shweta LodhaRank #31 · 39.8K reputationPosted Aug 28, 2014, 1:58 AM EDT
This can be achieved using SQL server.
Sample code is given over here:
http://stackoverflow.com/questions/6464601/how-to-validate-a-csv-file-before-importing-into-the-database-using-ssis
Santosh Kumar127 reputationPosted Aug 28, 2014, 2:07 AM EDT
Thanks for reply, Please can u suggest a simple one instead of SSIS package.