Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i have a set of values in a datatable . now i have to validate these data with my table in database . I dont want to hit the database one by one to verufy each datarow . Please suggest any method in which i can validate all theses data by hitting database only once .
Posted
Comments
Mohamed Mitwalli 20-Mar-12 1:30am    
hi
validate like see changes and apply it or what ?
please clarify .
prejval2006 20-Mar-12 1:37am    
ya i have to check whether these are present in database .
Mohamed Mitwalli 20-Mar-12 1:48am    
Hi,
One question?
means you need comparison from both of the table.
I need to know that you need to compare all the fields Or specific fields only.
please mention !!!!

Or mention the result you need
prejval2006 20-Mar-12 1:50am    
no actually i am getting some data from excel which i have to verify whether it is present in database . And i have to verify only a single column .

If you know which SQL statements you're going to execute beforehand, you can bundle them into one call to the database, and return multiple result sets using ADO.NET
 
Share this answer
 
Send the dataset as an XML document to the database, use OPENXML in the stored procedure to convert it back to table format and do your validations. refer http://msdn.microsoft.com/en-us/library/ms186918.aspx[^]
 
Share this answer
 
v2
bring the table in Ado.net store that table in a datatable and match with your existing table. that's it.
 
Share this answer
 
hi 
u can bring data into datatable from database and u can add new columns Flag and for any record has been change u can mark this one as it changed 

i hope this solution satisfy your needs . 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900