•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,530 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,779 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5930 | Replies: 1
![]() |
•
•
Join Date: Aug 2007
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 0
Hello Everyone,
In my sql database I am having a country field and a State field with some values and also some null values and I am populating the country values into a dropdown list box in the frontend using database connection
e.g.
Country
India
Indonesia
null
Iran
My requirement is, if I select the particular country in the dropdown list box, I need to display the rspctive state assigned to it, If I select the null value, all the state and country should be displayed. I need the coding for the above null condition in c#.
Thanks
Sasikala
In my sql database I am having a country field and a State field with some values and also some null values and I am populating the country values into a dropdown list box in the frontend using database connection
e.g.
Country
India
Indonesia
null
Iran
My requirement is, if I select the particular country in the dropdown list box, I need to display the rspctive state assigned to it, If I select the null value, all the state and country should be displayed. I need the coding for the above null condition in c#.
Thanks
Sasikala
Last edited by sasikala123 : Oct 9th, 2007 at 3:45 am.
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation:
Rep Power: 7
Solved Threads: 59
I'm not certain of what you require. But perhaps you need DBNull.Value this represents a null database value. For example you can comapare a value in a DataSet to DBNull.Value which returns true if the value is null.
if(myDataSet.Rows[0]["columnName"] == DBNull.Value)
//the value is null.![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- i++ and ++i (C)
- null check of resultset (JSP)
- Tic-Tac-Toe Game - Need some information or help (C++)
- how to select null values in condition (MySQL)
- Issues with check boxes (Visual Basic 4 / 5 / 6)
- Check to see if null (VB.NET)
- new and malloc (C++)
- How to be Crash Free (C++)
- help with sort using Calendar class getting null pointer exception (Java)
Other Threads in the ASP.NET Forum
- Previous Thread: Crystal Reports for ASP.Net
- Next Thread: Reporting Services (how to show icon printer)



Linear Mode