Solved

Saving a sql record when combo box is empty.

Posted on 2013-06-12
2
231 Views
Last Modified: 2013-06-15
I have a small issue tracker vb .net app I created that uses sql server.
I have 2 tables, issues and related issues, joined on issueID in a 1 to many relationship.

My form has several fields, 2 of them are combo boxes which are Opened By and Assigned To
i created a dataset called Contacts, I then plop it onto each of the combo boxes, at this point everything is as expected. Scrolling through the records, each of the combo boxes is displaying the correct person.

The problem occurs when I need to blank out one of the combo boxes, Assigned To in this case. I then click save and close the form, now if I go back to the form to that record it still has the original person, not blank as expected. If I pick someone else instead of emptying the field and save it, then it does get saved.

Hopefully that's enough information to get an idea what my issue is.

Thanks
MW
0
Comment
Question by:WINN2012
2 Comments
 
LVL 1

Accepted Solution

by:
jay813 earned 500 total points
Comment Utility
What does your update statement look like?  When you say 'blank' are you meaning you are trying to set the field for [Assigned To] to 'null' in the DB?  Have you tried using something like "N/A" (or a string value) instead of leaving it 'blank' to see if that works?
0
 

Author Comment

by:WINN2012
Comment Utility
Its the normal save when you add a dataset to a form. Its on my work pc so I can't paste it atm.
Yes I basically want to set the value to null in the DB, all I am doing is deleting the users name from the field.
I had thought about adding a N/A to the Contacts Table as you mentioned.

Thanks
MW
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

728 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

15 Experts available now in Live!

Get 1:1 Help Now