I've written a SQL statement that will check the class capacity (as below):
myOleDbCommand.CommandText = "SELECT Capacity FROM Classes WHERE ModuleID = " + lstModCode.SelectedItem + " ";
But is there a way to use the data its pulled as capacity, to link it to an if statement.
E.g if (capacity > 25)
{
Messagebox.Show(Insert message here)
}
Or would the data its pulling back need to be stored somewhere?
Loading

Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 17, 2013, 9:42 AM EDT
Katie B66 reputationPosted Apr 17, 2013, 9:48 AM EDT
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 17, 2013, 9:56 AM EDT
the following will give you data only where capacity is > 25 and then you can work on this dataset.
SELECT Capacity FROM Classes WHERE ModuleID = " + lstModCode.SelectedItem + " and Capcity > 25";
Katie B66 reputationPosted Apr 17, 2013, 9:58 AM EDT
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 17, 2013, 10:05 AM EDT
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 17, 2013, 9:57 PM EDT
I did not get you.
What exactly your requirement is?? Please elaborate...