Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2008

Tip: Looking for answers? Try searching our database.

Return an array with null values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dwischnewski@gmail.com - 11 Mar 2008 10:40 GMT
I have the following code (excerpt):
<code>    public struct UserAddress
   {
       public int ID;
       public string companyName;
       public string address;
       public string city;
       public string zip;
   }
   ...
       [WebMethod]
       public List<UserAddress> GetAddresses(int UserID)
       {
           DbCommand cmd;
           DbParameter param;
           DbDataReader reader;
           int Idx;
           ...
        }</code>
If I have no data, for example for the field "companyName", I want to
return a NULL value (probably by omitting the value node from the
response xml). However, all my attempts to get there, always simply
return an empty node, e.g.: <companyName />.

Is there any way to accomplish this, we need to be able to differ
between empty strings and null values in the database.

Thanks,
Daniel
sakura - 11 Mar 2008 12:49 GMT
Never mind, somehow Visual Studio did not run the correct project and
all changes to the source did not affect the outcome at all. As to why
this is, I got no idea.

Simply setting the value to NULL achieves the desired result.

Thanks,
Daniel

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.