473,606 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ 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.Ta bles[<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
2 2299
Peter,
I had a similar problem in VB .Net. Solution was to convert to string.
Depending on what I was working with I either used CSTR() or
expression.ToSt ring

As for current row in a dataset, haven't seen any easy method. When I go to
a form, it's usually from a datagrid and I use CurrentRowIndex . Or if
sorted, find the record I want.

"mrstrong" wrote:
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.Ta bles[<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

"mrstrong" <mr******@hotma il.com> wrote in message
news: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.Ta bles[<table>].Rows[0][<field>]== 'Y')


should be: =="Y"

oracle pl/sql -> c# caused my confusion.

Thanks,

Peter
Nov 24 '05 #3

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

Similar topics

9
4642
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 = eval("document.imageForm.move" + ""); alert(moveElement); if (document.imageForm.select_all.checked) {
4
4663
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 to a category by checking the checkbox next to their name (say I've looped out 100 of them, and check some, and not others) then submitting the form for processing, so that those titles where the checkbox is checked will get the categoryid number...
4
19983
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
1708
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 Create or replace TYPE TEST_TYPE AS OBJECT ( ....,....)
3
1834
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 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:
34
3778
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 function needs to run and validate all the checkboxes on my form and make sure none of them are unchecked. I suck at Javascript and my problem is 2fold. I have the following code that constructs the checkbox response.write "<input type=checkbox...
12
9482
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 use "long long" integer type(64 bit), but it seems that Oracle doesn't like it after execution, and giving me error code -1460, any idea about this? thx
3
4257
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 large oracle database. This is my company database. I am having two very huge tables containing crores of records. I have to match each record from one table (I'll call it base table from here onwards) to another table which may contain one or more...
0
4081
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 return me Array element type code 1, but it is returning me type code 12 and the array in a junk or unreadable format . Our environment is JDK 1.4, ojdbc14.jar and Oracle 8i Not able to find out what they problem is and am not able to change the...
0
8016
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8440
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8431
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8096
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8306
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6773
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5966
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.