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
Solved

Trying to save data type NULL or integer in parameterized query

Posted on 2013-06-02
6
280 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

807 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