G
Geri Reshef
I'm trying to get into C# after a long love affair with VB6..
1. In VB I had the 'iif' and the 'isnull' functions which helped me to easily constract dynamic SQL statements. For example:
S="Select * From MyTable" & iif(isnull(MyControl),""," Where MyField=" & MyControl)
How can I do that in C#? what are the equivalents of iif and isnull?
2. Is there an equivalent for NZ function (the function NZ(X,0) returns the value of X if it is not null and 0 if it is null).
3. I wrote a simple event for the combobox- MyCombo_SelectedIndexChanged which will run after I select a value (I initialize the combo when I open the form with a DataSet).
Unfotunately the procedures runs during the initialization because it automativally receives the value of the first item in the dataset. How can I prevent it from running (I want it to run only when I manually change the value)?
1. In VB I had the 'iif' and the 'isnull' functions which helped me to easily constract dynamic SQL statements. For example:
S="Select * From MyTable" & iif(isnull(MyControl),""," Where MyField=" & MyControl)
How can I do that in C#? what are the equivalents of iif and isnull?
2. Is there an equivalent for NZ function (the function NZ(X,0) returns the value of X if it is not null and 0 if it is null).
3. I wrote a simple event for the combobox- MyCombo_SelectedIndexChanged which will run after I select a value (I initialize the combo when I open the form with a DataSet).
Unfotunately the procedures runs during the initialization because it automativally receives the value of the first item in the dataset. How can I prevent it from running (I want it to run only when I manually change the value)?