Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CompareData(DataTable dt) {
- foreach (DataRow entry in dt.Rows) {
- //select that row
- DataRow dbEntry = ExecuteQuery("SELECT * FROM Parts WHERE partno='" + entry["partno"] + "'").Rows[0];
- if (dbEntry["info1"] == entry["info1"]) {
- //do something
- } else {
- //do something
- }
- }
- }
- void CompareData(DataTable dt, string[] parts) {
- DataTable dbEntries = ExecuteQuery("SELECT * FROM Parts WHERE partno IN('" + String.Join(parts, "','") + "')");
- foreach (DataRow entry in dt.Rows) {
- foreach (DataRow dbEntry in dt.Rows) {
- if (dbEntry["partno"] == entry["partno"]) {
- if (dbEntry["info1"] == entry["info1"]) {
- //do something
- } else {
- //do something
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment