Validate the Data in the Datatable

Posted by Hanu412 under ASP.NET on 11/23/2013 | Points: 10 | Views : 5079 | Status : [Member] | Replies : 2
I have a datatable which is being filled with the data that is read via an excel sheet. This datatable has to be validated. It contains 34 columns of varying data types like char,datetime,string,int etc.

Conditions for validation ::
1.Of these 34,12 columns should not be null.
2. These 12 columns have fixed datatypes. (ex: col 1 must be char,col 3 must be string etc)
3. If each row passes the above two validations,the entire row should be added to a new datatable2.
4. If either 1 or 2 fails,that row should be added to a new datatable3.

For those who want to try this,please try it for a table with 10 columns and take mandatory columns as 4 instead of 12. Select your own datatype for each of the column.


Posted by: t5j9033387989 on: 11/28/2013 [Member] Starter | Points: 25

i think you should visit this,

mark this answer if it will really help you,


Hanu412, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response