Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

combo box databinding problem

Posted on 2006-07-20
2
Medium Priority
?
223 Views
Last Modified: 2010-04-23
Hi, everybody,

I have a winform combo box that binds to a dataset created by a sql stored proc. My question is how to make the combo box default to an empty/null value?

The combo is for users to select a Region as searching criteria. It has to be optional, meaning, it has to contain an empty entry with the regular West, East...

Do I make my stored proc returns an empty line at the top of normal data set, or add an empty entry into combo box after it was populated?

Neither seems is the right way to handle the situation.

Thanks!
0
Comment
Question by:ommer
[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 17

Accepted Solution

by:
ZeonFlash earned 375 total points
ID: 17149883
Either way is acceptable.  

SELECT NULL, NULL
UNION
SELECT Region, RegionValue
FROM ...

--Or--

'Fill dataset

Dim dr As DataRow = ds.Tables(0).NewRow

For Each col As DataColumn In ds.Tables(0).Columns
      dr.Item(col) = DBNull.Value
Next

ds.Tables(0).Rows.InsertAt(dr, 0)

'Bind dataset to combobox here
0
 

Author Comment

by:ommer
ID: 17153837
Cool!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

661 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