Return an array with null values

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
.



Relevant Pages

  • Re: RasEnumEntries returns only 1 dial up entry (PocketPC)
    ... public int reserved1 = 0; ... public string szPhoneNumber; ... public extern static uint RasHangUp( ... // buffer to hold error string ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to declare GetOpenFileNameEx in C#
    ... public IntPtr hwndOwner; ... public string lpstrCustomFilter; ... public int nMaxCustFilter; ... public IntPtr lpstrFile; ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: WNetAddConnection2
    ... I managed to recreate my error from the command prompt with the following ... So I got to thinking about the username and tried ... ... public int dwScope; ... public string lpRemoteName; ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Which generic?
    ... public string description; ... static void Main ... foreach(Column col in myCols) ... public int IndexOf{ ...
    (microsoft.public.dotnet.languages.csharp)
  • Namespace confusion
    ... fulfilmentRequestID = dataAccessObject.GenerateFulfilmentRequest(orderID, ... public string status; ... public int customerID; ...
    (microsoft.public.dotnet.framework.aspnet.webservices)