StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


12»»

Conversion from type 'DBNull' to type...Expand / Collapse
Author
Message
Posted 05/26/2006 10:53:48 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 01/10/2008 9:33:30 AM
Posts: 65, Visits: 820
Hi,

when retrieving data from Oracle database a VARCHAR2 field being NULL gives an expections. When there is text in the field then the select works ok.

What might be the problem here and how can it be solved?

TIA,

Kari

ps. I did find some other post related to null values put not quite like this. Also, when can we expect the next release with the DevExpress wrapper among other enhancements :-)

Picture attached

  Post Attachments 
nullexception.gif (37 views, 14.84 KB)

Post #1281
Posted 05/26/2006 11:00:27 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
You will need to go through the BOMapper and customize your "WWW" field so that it will return an alternate value on NULL.  Within the BOMapper, select the business object, then select the WWW field.  Right-click the field and select Customize from the context menu.  In the customization dialog, select "Return Alternate On Null" as the null value handling type, and then set the return value to either "Nothing" or "String.Empty" (without the quotes) and the field will return the appropriate value when a NULL value exists in the database.

As for the DevExpress wrapper, I'm building the install right now.


www.bungie.net
Post #1282
Posted 05/26/2006 11:41:14 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 01/10/2008 9:33:30 AM
Posts: 65, Visits: 820
Hi Ben,

thanks, that worked fine.

Kari

ps. Is there hope that we would have the next release available still this weekend?

Post #1283
Posted 05/26/2006 12:30:13 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 01/10/2008 9:33:30 AM
Posts: 65, Visits: 820
Hi,

one additional problem: when I try to update the WWW-field I get "ORA-00936 Missing Expression" error.

So this is an Oracle error saying - I guess - that there is a problem with the update SQL-statement. What might go wrong here and is there a way to see the update statement SF is sending to the database.

Thanks again,

Kari

The error window "An error occured while saving an the data to the server"
================

BusinessLayerException
 An error occurred while saving an the data to the server.
DataLayerSavingException
 ORA-00936: missing expression

OracleException
 ORA-00936: missing expression


Source     : MicroFour StrataFrame Business

Stack Trace:
   at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor)
   at System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
   at MicroFour.StrataFrame.Data.OracleDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)
   at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)
   at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)
   at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()
   at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Post #1285
Posted 05/26/2006 12:59:40 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
We updated the debug mode in the version that I'm building to allow for the debugging of INSERT, UPDATE, and DELETE commands.  Before this version, the debug mode on the DbDataSourceItem class only showed SELECT commands.  So, once we get the new build to you, you can call SetDebugOn() on the DbDataSourceItem and you'll be able to see the command that is being sent to the database, and that will give us a clue.


www.bungie.net
Post #1286
Posted 05/26/2006 1:03:21 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
The next release will be out before I leave the office today (4 hours or so to go)


www.bungie.net
Post #1288
Posted 05/31/2006 4:41:56 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 01/10/2008 9:33:30 AM
Posts: 65, Visits: 820
Hi,

what might be the problem here: with the new relaese I still get the same ORA-00936 error mentioned in my previous post. Setting the debug on only shows the select statement - still the error appears when trying to save the changes.

Currently I'm testing this with the simplest possible query - just a couple of columns in the table. With SF samples everything is ok. Might the problem be with the SQL and Oracle? Unfortunately I didn't manage to find the right place to debug the application so that I could see the UPDATE statement.

Any ideas how to resolve this...?

Thank you for all your help,
Kari

Post #1309
Posted 05/31/2006 4:58:13 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Well, Kari, I'm not sure why the debug isn't working, but I'm building you a maintenance release right now that has some additional debugging information.  You can install this one and just leave it installed, don't worry about going back to the pre-release.

Once you get it installed, it should give you more information in the debug file.  Also, if you can get the version of Oracle that you're running, the table structure (screenshot or CREATE TABLE script would be fine), and the .Designer.vb file for the business object and post those with the output from the debug file, it will go a long way towards helping me to reproduce the error. 

Let me know Thanks

P.S.  I'll post the maintenance install here in a second.


www.bungie.net
Post #1310
Posted 05/31/2006 5:13:12 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
OK, Kari, here's the maintenance install.  Just let me know what you find.  You'll have to pull the setup exe out of the zip file... the forum won't let you upload executables.

Thanks