Retrieve Bit Type

I have a problem with Bit DataType.

I have a table that stores Bit data.
I have to get the value of the bit data and set it as the Selected value of a dropdownlist.
Iam using a SqlDataReader.
When I try using rd.GetBoolean(int). I retrieve the value as true or false;
But when I update Update the VAlue to the DataBase I am getting an Error could any body help me plz.
12/3/2004 5:48:11 PM 16182 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 12

Show what you are doing.  As a hint, using parameters will make this ever so much easier.
Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
12/4/2004 2:03:36 AM

What i am doing is getting the value stored in database a bit value denoting 1 or 0 and storing it in a dropdownList.SelectedItem.Value.
Actually I am retrieving a Lot of values and one among them is this bit value. I am storing the values that i get from the database into the DropDownLists and into the TextBoxes.
Thanks again
12/8/2004 5:31:27 PM

Similar Artilces:

Difference between var type of .NET 3.5 and object Data Type in .NET 2.0?
Hi All,With .NET 3.5 a new feature is introduced of defining Anonymous Type.You can achieve this with keyword "var".We can achieve the same functionality in .NET 2.0 with object type.What is the difference between var type of .NET 3.5 and object Data Type in .NET 2.0?Virendra (MCTS)My Site, Blog virendra1983:With .NET 3.5 a new feature is introduced of defining Anonymous Type. var types are actually strongly typed in design time. What happens in the IDE infers the type of the object based on its initialisation so you get strong typing and intellisensee.g.var i = 9...

Cannot assign object of type object to variable of type object
Does anyone know if this problem has been corrected yet and if so what EBF for 7.02. Any help would be greatly appreciated. Thanks in advance. -- Thanks David Warner I'm confused. The only data type I can see of type object is an enumerated data type that takes values like Window! Can you give us a code snippet of what functionality fails? I'd be glad to test it in the latest EBF. Let us know, Terry [TeamSybase] and Sequel the techno-kitten On Tue, 25 Apr 2000 13:18:15 -0400, in powersoft.public.powerbuilder.general David Warner <...

Dont know where to make a object of type object winkelmandje!! (
Hallo, I have a little question about my script... I have make a simpel shopping chart (learning only) in this scart-script i made a class winkelmandje, and a class producten... now my mentor ( a vriend who is helping me too learn) is not availible for me at the moment but i to go on, he is writing a comment too me. "The code is not working, you have too take away the line "Dim Mmandje = new arraylist",  "Do not use Mmandje but a object of the type winkelmandje" Now i have this part "Dim Mmandje = new arraylist" on two places in the script, must i take away ...

Hi, i have a piece of code in VB which works fine: If Convert.ChangeType(value, valueType) > _ Convert.ChangeType(ProvidedProperties.MaxValue, valueType) Then Return sDisplayName & " is greater than the maximum value of(" & ProvidedProperties.MaxValue End If BUT WHEN i writesame code in C# it says: Operator '>' cannot be applied to operands of type 'object' and 'object' The C# code i am writing is: if(Convert.ChangeType(textvalue, valueType) > Convert.ChangeType(ProvidedProperties.MaxValue, valueType)) ...

Cannot assign object of type <Object> to variable of type
Hi, In PB 11 Application, I am getting "Cannot assign object of type <Object> to variable of type n_cst_platformwin32 ......." In debug mode I identified the nep_n_cst_dwsrv_printpreview objects of_setenabled function.. ........ n_cst_platformwin32 lnv_platform lnv_platform = gnv_app.inv_platform ..... above code, 'Cannot assign object or type n_cst_platformwin32...' this is inheritedy by n_cst_platform and pfc_n_cst_platform. Any one have idea? Advanced thanks for your help. "Chaithu" <> wrote in message ...

Retrieve Bit type value
I am trying to populate some controls on a web page with values retrieved from a sql server database recordset. The text type controls work fine. However I have a Check Box on my form. I get a runtime error when I try to write into it. So tried wrting the value into a text control and was suprised to see the value retrieved was "S00817". Heres the relevant line of code Message.Innerhtml=MyDataset.tables(0).Rows(0)(12) I would expect this to come up with a 1 or a 0. I get S00817 if the database record holds a 1 or a 0. So what is going on here? You're not selecting what you ...

retrieve original datasource object
Is it possible to retrieve the collection object that was originally used to bind the datagrid? I know that you can loop through each cell in each item and pull the values that way, but if the datagrid only displays a selct number of fields from the collection, is it possible to gain access to the other values that are not being displayed? mbehrend, The ItemDataBound event of the grid will give you access to the DataItem that you will need to cast to your custom object using the event args: private void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e){ ...

Update error , "Unable to cast object of type 'System.DBNull' to type 'System.String'" , using DataSet as a datasource
Hi All, The following sample code is for testing dw.UpdateData using dataset as the data source. The data retrieval and display part under Form1_Load works fine. However, inputting some values in a new row and calling dw.UpdateData causes the following error: "Unable to cast object of type 'System.DBNull' to type 'System.String'" The error seems to occur when a datawindow column value has been changed from null value. Does anyone know how to fix the error ? Thank you for your advice. I use DW2.5 (build 8542), VS2005 pro, MS SQL Express. ...

Unable to cast object of type 'TYPE' to type 'TYPE'.
I've got a custom class and collection...I want to use them to databind a Grid, and persist the state using a Session variable.  However I keep getting the above error **Sometimes...There will be times when it works fine, and times when it totally craps out.System.InvalidCastException: Unable to cast object of type 'ApprovalCycleCollection' to type 'ApprovalCycleCollection'. This should work fine, no?  I want a property to use in all my foreach loops   public ApprovalCycleCollection NewApprovalCycle { get { if (Se...

Object Datasource Udpates with Typed Datasets
Hello,Like many people I'm struggling with getting the ObjectDatsource update to work in a reasonable manner. I planned to use Typed datasets for by business entities to pass around between layers of my app but I can't easily get the udpate to work directly with a dataset. Let me set the scene :I have a Customer typed Dataset "CustomerDS", containg a Customer table and therefore a CustomerRow object. Imagine by business logic layer methods :public CustomerDS getCustomerByName(string custName) public void writeCustomer(CustomerDS customer)public void writeCustomerRow(CustomerDS.CustomerRow ...

Does ADO.NET Type data as it retrieves
For instance if I am getting a lets say 64 or a 16 bit company ID and I use CompanyId = dataReader.GetInt32(dataReader.GetOrdinal("companyid"));Will it try to cast it or shouldnt it blow up because the type in the DB does not match the type I am feeding it into?  I know in ADO it would just try it and go on, however I assumed with as it got the data it would type it.Those who say it can not be done, should not interrupt those who are doing it! It does not try to cast it, the data has to already be Int32 for this to work properly.  I imagine if its not you'll get an excep...

Replace the .NET 1.1 Behavior-Object with the .NET 2.0 Tag-Object , How to?
Hello, to set the Style - Attribute of my custom controls tag in source view from within its designer i use now the following code:Behavior.SetStyleAttribute("Left", false, val, true);This works fine but my visual studio 2005 / 2.0 says that the Behavior object is obsolete. The recommended alternative is the Tag object. But when i use it to set the Style attribute it doesn't work . I can set all other attributes or even create new ones using this Tag object but it does'nt work for the style attribute at all. What am i doing wrong? If I can't set the style attribute in my custom contr...

error: Object of type 'Object' cannot be converted to type 'Array'.
I'm getting the error listed in the subject of this post that is occurring due to a a conflict between Mootools and the .NET-generated JS when using AJAX as described in the following link: To get a detailed view of the error, open the following page in Firefox and use Firebug to see the error details.  IE will just show the error icon at the bottom left of the window and it doesn't give much detail about the error. The collision is occurring on line 5762 of the "Script...

Error Number 23 , cannot Assign Object of Type u_ddlb to Variable of type u_ddlb, Inherited object
Hi!, I am having a Problem, with powerbuilder , All objects in our application are inherited from PFE library , mainly PFEMAIN.PBL, Example when I inherit an object u_ddlb from pfemain and place it on one of th etabpages in the application , It compiles fine, but at runtime, It gives This Error, saying, Error Number 23, Cannot assign object of type ddlb_1 to variable of type ddld_1 create script line number 5 Anyone Please can you help me with this, Thanx, Tried a full rebuild? Wendell. <Jimmy> wrote in message news:BD514ECACA2C71AB0076644C85256AB...

Web resources about - Retrieve Bit Type -

Facebook Developers Can Retrieve Users’ Profile Pictures In Different Sizes
Facebook introduced a way for developers to retrieve users’ profile pictures for use within their applications in different sizes, rather than ...

Winston retrieves the news - Flickr - Photo Sharing!
... food and losing weight. Three months ago, we were told he had lymphosarcoma of the GI tract. On March 10, 2008, Winston was called to go retrieve ...

Dolphin retrieves phone for a lady after it fell in the ocean - YouTube
Dolphin retrieves phone for a lady after it fell in the ocean

Man killed by train after jumping on tracks to retrieve something
A man has been killed by a train after jumping onto the tracks to retrieve something at Wentworthville Station.

People Are Willing To Go To Extreme Lengths To Retrieve Their Stolen Smartphones
People are willing to pay a ton of money and potentially put themselves in danger to retrieve their stolen smartphones, a new survey has found. ...

NSA surveillance program can retrieve, replay phone calls
The NSA has built a voice interception program capable of recording 100 per cent of a foreign country's calls and replaying voices from calls ...

Divers retrieve body from NSW floodwaters
A woman's body has been retrieved from a submerged car in a creek in Maitland.

Tourist plunges to death from Potts Point rooftop park trying to retrieve football: police
A French tourist who fell to his death from a rooftop park in Potts Point in inner Sydney was attempting to retrieve a football that had gone ...

Rescuers retrieve bodies after Brazilian tour bus crash kills 54
At least 54 people have been killed after a tour bus plunged hundreds of metres into a densely wooded ravine in southern Brazil, authorities ...

Investigators retrieve more human remains at MH17 crash site in eastern Ukraine but wreckage cannot yet ...
Dutch forensic experts recover further human remains at the crash site of downed flight MH17.

Resources last updated: 12/8/2015 9:59:10 AM