Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Null value table cells with optimized compiler

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-04-2008, 09:38 AM
Knows the basics
 
Join Date: Oct 2007
Location: Berkshire, UK
Posts: 76
Awards Showcase
Beta Tester 
Total Awards: 1
Default Null value table cells with optimized compiler

This is not urgent as I've re-coded to avoid the issue - but perhaps interesting in case of future use.

How is it possible to trap Null values in a Table control column, in a program built with the optimized compiler? I always get an "InvalidCastException" when trying to access the cell.

The table is loaded from an SQL Select. Some columns may often be Null (no value, not ""). The cell is shown by assigning it to a Textbox.Text, expecting it to be blank if Null. Works fine in the IDE and if compiled un-optimized.

I attempted trapping it first, but always get the error as soon as the cell is referenced. It can be assigned to a variable, but then it has the same issue, as the value cannot be interpreted.

By changing to use the DataReader GetValue or IsDBNull instead, there is no problem.

Geoff.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Null modem emulator von WM5 schimanski Questions (Windows Mobile) 5 04-03-2008 12:14 PM
virtual null modem cable schimanski Chit Chat 0 04-01-2008 04:41 PM
Problem with Optimized Compiler mikemputer Questions (Windows Mobile) 3 01-26-2008 02:00 PM
The Hekkus Library doesn't work when used with the Optimized Compiler Louis Questions (Windows Mobile) 5 12-28-2007 08:06 PM
Trap the null value? conf Questions (Windows Mobile) 3 07-07-2007 12:49 PM


All times are GMT. The time now is 06:27 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0