Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


SQLite


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-10-2008, 02:12 PM
Junior Member
 
Join Date: May 2007
Posts: 43
Default SQLite

If optimize compiler I got error when run the program:
Impossible cast of objects of type System.DBNull on type
System.String

if not optimize compile all ok

Why?

I use bppc 6.30

best regards
Reply With Quote
  #2 (permalink)  
Old 06-10-2008, 06:56 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

It is probably because you got null values in your database.
You can use the IsNull keyword to check for null values.
Reply With Quote
  #3 (permalink)  
Old 06-18-2008, 06:16 AM
Newbie
 
Join Date: Jul 2007
Location: PA
Posts: 1
Default

Erel,

I am loading a table w/ cmd.ExecuteTable("tbl1",0) and it puts the nulls in the table columns.

Sub tbl1_SelectionChanged (ColName, Row)
if isnull(tbl1.Cell(ColName,Row)) then tFld.Text="" else tFld.Text = tbl1.Cell(ColName,Row)

Causes 'Specified Cast is Invalid' Error
Is there a way to detect the Nulls?
__________________
AlT
Reply With Quote
  #4 (permalink)  
Old 06-18-2008, 03:36 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

You can replace the Nulls with some other value.
See this thread: Specified cast is not valid (last post)
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 On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:47 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0