Guest User

Untitled

a guest
Jan 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. void CompareData(DataTable dt) {
  2. foreach (DataRow entry in dt.Rows) {
  3. //select that row
  4. DataRow dbEntry = ExecuteQuery("SELECT * FROM Parts WHERE partno='" + entry["partno"] + "'").Rows[0];
  5. if (dbEntry["info1"] == entry["info1"]) {
  6. //do something
  7. } else {
  8. //do something
  9. }
  10. }
  11. }
  12.  
  13. void CompareData(DataTable dt, string[] parts) {
  14. DataTable dbEntries = ExecuteQuery("SELECT * FROM Parts WHERE partno IN('" + String.Join(parts, "','") + "')");
  15. foreach (DataRow entry in dt.Rows) {
  16. foreach (DataRow dbEntry in dt.Rows) {
  17. if (dbEntry["partno"] == entry["partno"]) {
  18. if (dbEntry["info1"] == entry["info1"]) {
  19. //do something
  20. } else {
  21. //do something
  22. }
  23. }
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment