Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Datatable.select doesn't always work

$
0
0

I have a problem with (foreach datarow row in datatable.select("item" = ..)) It doesn't always work. Usually it does work but sometimes even though all the criteria is met it doesn't work. For example

  foreach (DataRow row in InvoiceOnPage.dtProductsForInvoice.Select("item = " + dgvList.CurrentRow.Cells["item"].Value))

Main.itemInfo.lblItemAlreadyOnInvoice.Text = "Item already on invoice!";

}

I want a label to notify the user if the item they are attempting to add onto the invoice is already on the invoice. So the computer loops through to check if the current row["item"] = item in the datatable, and if it is it will say "Item already on invoice". So I tried it out a few times and most of the times when I reselected the item the message came up but every so often it didn't. I debugged and the current item was in the datatable but it seemed to not pick that up. What can I do about this?


Debra has a question


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>