Problems with NULL


Author
Message
Howard Bennett
Howard Bennett
StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)
Group: Forum Members
Posts: 57, Visits: 496
I'm using DDT to setup a new database.  When I started I uncheked "Allow Null default value."  Don't know why - just thought that's what I was supposed to do...

I was able to setup my table and put fields on a form - no problems. 

I decided to add a couple of fields and the deployment to the server fails - b/c "Allow Null" is not checked (like the other fields.)  If I check the field - the deployment works - but the app fails with a "Conversion from type 'DBNull' to type 'String' is not valid."

Just need someone to tell me where I messed up and how to fix it - thanks!

HB

Replies
Howard Bennett
Howard Bennett
StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)
Group: Forum Members
Posts: 57, Visits: 496
So...let me be sure I've got this straight...

When I setup the table - I am correct in unchecking the "Allow Nulls" checkbox - and when adding fields, I need to be sure there is a default value and the "Allow Nulls" is not checked.  Is that right?

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Correct.  You really don't want to allow null values within a database if you have control over it.  When you initially create your structures, you can leave the Default blank and not select Allow Nulls and deploy without any type of error as you are deploying a new structure where there are no records...thus no field values have to be initialized.  But when you go back into that structure and add new columns to an already deployed table, you will want to be sure to supply a default value, otherwise you will run into the issue that you experienced.  But it is best to not allow nulls. Smile
Howard Bennett
Howard Bennett
StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)
Group: Forum Members
Posts: 57, Visits: 496
Thanks for the help...again...
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
No problem Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Howard Bennett - 17 Years Ago
Ivan George Borges - 17 Years Ago
Greg McGuffey - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Howard Bennett - 17 Years Ago
                         Correct. You really don't want to allow null values within a database...
Trent L. Taylor - 17 Years Ago
                             Thanks for the help...again...
Howard Bennett - 17 Years Ago
                                 No problem :)
Trent L. Taylor - 17 Years Ago
             Okay - that did the trick - thanks!
Howard Bennett - 17 Years Ago
Howard Bennett - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search