DBNULL...again


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Scenario:

I have inherited a table with two fields, one decimal, one string. These together represent the primary key. I need both fields on a maintenance form, bound to textboxes.

Display/Edit/Save is working. I cannot get a new record to add.

I get 'Conversion from type 'DBNull' to type 'String' is not valid.' on the line:

Return CType(Me.CurrentRow.Item("ITREPORT"), System.String) in the field properties. I tried to set the defaultValues and the first one sets fine, the second always gives the above error, regardless of the order set. I have PrimaryKeyIsAutoIncremented = False, PrimaryKeyIsUpdateable = True, and even tried out AllowNullsOnNewRow = True. The database fields (DB2) are set to not allow nulls, and have default values set.

I know this could be fixed easily by adding a proper autoincrement key column but I cant, the table is part of a legacy system and the customer is insistant it work as described above, frankly I'm not sure why it isnt. It works fine if the fields are unbound from the textboxes.

I must be missing somethign simple. Which is likely since I havent been coding much lately.

 



Keith Chisarik
Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Keith Chisarik (05/05/2008)
I'll admit I am confused why that step was necessary, but I'll save that for another day, unless someone is feeling like enlightening Smile

Well basically that step is there to allow you to handle your specific database Null values, so you can accommodate your SF project to be compatible with any DBNull schema used.  In your particular case you don't have access to modify the database the way you want it, but that will not stop your SF project to keep working.

Just my 0.02 Smile

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Keith Chisarik - 17 Years Ago
Keith Chisarik - 17 Years Ago
Peter Jones - 17 Years Ago
Keith Chisarik - 17 Years Ago
Keith Chisarik - 17 Years Ago
Edhy Rijo - 17 Years Ago
Keith Chisarik - 17 Years Ago
Edhy Rijo - 17 Years Ago
Keith Chisarik - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Keith Chisarik - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Keith Chisarik - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Keith Chisarik - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Keith Chisarik - 17 Years Ago
Keith Chisarik - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Keith Chisarik - 17 Years Ago
             Cool :cool:
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search