Solved

Saving a sql record when combo box is empty.

Posted on 2013-06-12
2
237 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
[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
2 Comments
 
LVL 1

Accepted Solution

by:
jay813 earned 500 total points
ID: 39243154
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
ID: 39243168
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

628 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