M
mrstrong
Gday,
I have a checkbox on my windows forms that I need to set based on a
value in a dataset which is populated by an odp data adapter via a web
service.
The value in the oracle database is of type char(1) with possible values 'Y'
or 'N' (there are no boolean values in oracle).
The code (c#) that I currently have that is being called from the form's
load procedure to set the checkbox is as follows:
if (dsMyDataSet.Tables[<table>].Rows[0][<field>]== 'Y')
chkBox.Checked = true;
else
chkBox.Checked = false;
However there are two issues that I hope you might be able to point me
in the right direction with:
1. How do you do comparisons for type char? (I get this message:
Operator
'==' cannot be applied to operands of type 'object' and 'char')
2. I am not sure how to reference the current row in the dataset
If this is not the right forum please point me in the right direction.
Regards,
Peter
I have a checkbox on my windows forms that I need to set based on a
value in a dataset which is populated by an odp data adapter via a web
service.
The value in the oracle database is of type char(1) with possible values 'Y'
or 'N' (there are no boolean values in oracle).
The code (c#) that I currently have that is being called from the form's
load procedure to set the checkbox is as follows:
if (dsMyDataSet.Tables[<table>].Rows[0][<field>]== 'Y')
chkBox.Checked = true;
else
chkBox.Checked = false;
However there are two issues that I hope you might be able to point me
in the right direction with:
1. How do you do comparisons for type char? (I get this message:
Operator
'==' cannot be applied to operands of type 'object' and 'char')
2. I am not sure how to reference the current row in the dataset
If this is not the right forum please point me in the right direction.
Regards,
Peter