I've been tasked with building a validation tool that will basically preprocess data before it's entered into our database, things like validate email addresses, phone numbers etc.
I envisage having a form, where the user will select the input file and a drowpdown list with the type of import (this will determine what type of headers are we expecting on this input file).
So with this file (a filesystem path) and the type of import then I can do things like checking the headings (correct number, order etc)
The type of validation to be performed on each column will depend on the import and all this information will be stored in a configuration file.
It's been suggested to me that I should use generics and factory pattern but I find that this is beyond my skills level so I'm looking for something more simple...
It's been suggested to me that I should use generics and factory pattern but I find that this is beyond my skills level so I'm looking for something more simple...
Maybe to learn something about fenerics and factory pattern is the best choice..
Best Regards.
Molly
It's time to start living the life you are imagined.
franklores
0 Points
1 Post
Best approach to validate csv data in C#
Apr 19, 2012 05:12 PM|LINK
Hello,
I've been tasked with building a validation tool that will basically preprocess data before it's entered into our database, things like validate email addresses, phone numbers etc.
I envisage having a form, where the user will select the input file and a drowpdown list with the type of import (this will determine what type of headers are we expecting on this input file).
So with this file (a filesystem path) and the type of import then I can do things like checking the headings (correct number, order etc)
The type of validation to be performed on each column will depend on the import and all this information will be stored in a configuration file.
It's been suggested to me that I should use generics and factory pattern but I find that this is beyond my skills level so I'm looking for something more simple...
Thanks in advance.
adamturner34
Contributor
3834 Points
963 Posts
Re: Best approach to validate csv data in C#
Apr 19, 2012 05:43 PM|LINK
Strict data validation is best performed using regular expressions.
molly_c
Participant
1590 Points
401 Posts
Re: Best approach to validate csv data in C#
Apr 24, 2012 07:45 AM|LINK
Maybe to learn something about fenerics and factory pattern is the best choice..
Molly
It's time to start living the life you are imagined.