Validating DataTable?

25 views
Skip to first unread message

TJ

unread,
May 3, 2012, 1:47:37 AM5/3/12
to CSVChat
I use the ValidateDataReader Class, but I was wondering if there was a
version that also handled DataTables (in addition to IDataReader)?

Essentially I'm processing/importing the main records (products)
successfully and need to grab the reviews in the XML related to each
product and add them to a separate table. What I was thinking I could
do is build up a DataTable of reviews as I'm parsing the products. I
can do this easily as SqlBulkCopy can accept a DataTable, but I'd
really like to use the validation class to check the data first...

I can't really parse the XML twice (in case that's anyone's first
answer) as these are large files and a Guid is created and associated
to the product while its being imported, linking the reviews at the
same time the product record is being processed is much easier to to
track than parsing the file twice...

Thanks, TJ.

shriop

unread,
May 7, 2012, 9:52:32 AM5/7/12
to csv...@googlegroups.com
How about loading the data into the DataTable, then call CreateDataReader to get an instance of an IDataReader from your DataTable?

Bruce Dunwiddie
Reply all
Reply to author
Forward
0 new messages