?
Solved

Trying to save data type NULL or integer in parameterized query

Posted on 2013-06-02
6
Medium Priority
?
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 49

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
DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

 
LVL 42

Accepted Solution

by:
sedgwick earned 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

771 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