Solved

Trying to save data type NULL or integer in parameterized query

Posted on 2013-06-02
6
264 Views
Last Modified: 2013-06-02
Hi,

Here is my code. http://screencast.com/t/DSMCoDDc  I added the last optional parameter for 'review status'  and have two sub routine calls  that call this save routine.  The first, where I specify the 'review status' as one, we are all good and the record is created just fine, however when I use the second sub routine  call and 'Nothing" I get the error you see in the screenshot.  So what am I not getting

Thanks in advance!!
0
Comment
Question by:bluetundra
  • 3
  • 2
6 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39214227
on line 326, change @fkid_letter to @reviewed as the parameter name.
0
 

Author Comment

by:bluetundra
ID: 39214242
well that prevented the exception from firing but the record doesn't save to the DB if you look here http://screencast.com/t/YFvdJYY5 you see that 'reviewed' is 0 but when I call the routine I pass 'Nothing'.  Hmm?  Thanks
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39214274
on line 312 you are still referring to fkid_letter, just before the word values

fkid_letter) values (@address

try this as:

reviewed) values (@address
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39214383
check lines 320 and 326, they both should be @reviewed.
0
 

Author Comment

by:bluetundra
ID: 39214433
I'm not sure 312 should be 'reviewed'  Here is another screenshot but this time with the DB so you can see the column names.  No exception but it's still not saving.  I think I've implemented the last coment  http://screencast.com/t/XPrLMNTdQM
0
 

Author Comment

by:bluetundra
ID: 39214572
Hey Thanks both of you for helping me.  

I stumbled upon this link http://bytes.com/topic/visual-basic-net/answers/350316-how-can-integer-contain-null-value and reintroduced mself to the 'Object' data type.  

What was happening once my parameters were cleaned up is that when you assign an integer Nothing it renders as 0 but we wanted it to be DBNULL.Value which I changed as well from 'Nothing' in the calling routine
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now