473,480 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

checkbox oracle char type

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
Nov 23 '05 #1
3 1823
Hi,
You can use the ToString() functaion like this:
dsMyDataSet.Tables[<table>].Rows[0][<field>]== "Y"
Note:
It's "Y" not 'y'.
I hope that help you.
"mrstrong" <mr******@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ:43********@news.eftel.com...
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

Nov 23 '05 #2
Sorry,last relpy have a mistake ,
you should add ToString() after that DataRow
like :
dsMyDataSet.Tables[<table>].Rows[0][<field>].ToString()== 'Y'
Sorry for that Mistake!
"mrstrong" <mr******@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ:43********@news.eftel.com...
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

Nov 23 '05 #3
"nankailzq" <na*******@hotmail.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
Hi,
You can use the ToString() functaion like this:
dsMyDataSet.Tables[<table>].Rows[0][<field>]== "Y"
Note:
It's "Y" not 'y'.
I hope that help you.


thanks! oracle pl/sql -> c# caused my confusion with the quotes.

Regards,

Peter
Nov 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4634
by: Phil Powell | last post by:
I am producing a form using PHP on the back end and Javascript on the front end. The resulting script will come to the browser as follows: <script> <!-- function selectAll() { moveElement =...
4
4650
by: Bill | last post by:
I have a catalog of books which need to be categorized into different groups. Some of the books can be listed under more than one category. I'm creating a page where I can assign a group of books...
4
19964
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
3
1694
by: db2sysc | last post by:
1. In the oracle trigger we have a SINGLE INSERT STORED PROCEDURE CALLED MUTLIPLE TIMES with different values. But when changed to DB2, it gives SQL -746 ?? Any help?? 2. In oracle we have ...
2
2290
by: mrstrong | last post by:
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...
34
3744
by: clinttoris | last post by:
Hello Experts, I have been told to post this in the Javascript forum as I want to do this client side just before my form gets submitted. Once the user clicks the submit button a javascript...
12
9459
by: wenmang | last post by:
Hi, I am using following Oracle Proc-C compiler: Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006 (c) Copyright 2000 Oracle Corporation. All rights reserved. I like to...
3
4252
by: vikas000000a | last post by:
Hi All, I am new to this forum as far as posting a question is concerned, although I have quite frequently visiting this site as a guest. My quertion relates to preforming fast searched in a very...
0
4074
by: anuptosh | last post by:
Hi, I have been trying to run the below example to get a Oracle Array as an output from a Java code. This is an example I have found on the web. But, the expected result is that the code should...
2
2677
by: livmacca | last post by:
Hi, I am trying to create a web page whereby I first read data from Oracle Database and display the records out on the data grid. The data displayed is in order of one attribute say 'A' meaning...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7060
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7022
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.