Monthly Archives: July 2004

serializable datatables and web services in ado.net 2.0

In ado.net 2.0, datatables are serializable (grin grin grin) so that means you can return them from a web service (though you must fill the tablename property first). Below is what the xml looks like (compared below that, to what the same table looks look like  in a dataset)

Not much difference here. But it creates a few less steps on both the web service end and the client end and it bridges a gap for developers. I wonder how many of us tried to return a datatable from a webservice because we didn’t understand the depths of xml serialization and that datatable, up until now, did not implement iSerializable. And then had to do a bit of digging before we found a sentence somewhere that explained that you need to return the dataset. So we save some coding, but also a whole lot of figgerin’ for those folks who don’t need to grok soap and serialization just to move some data around.

 <?xml version=”1.0″ encoding=”utf-8″ ?>

<DataTable xmlns=”http://tempuri.org/>
<xs:schema id=”NewDataSet xmlns=” xmlns:xs=”http://www.w3.org/2001/XMLSchema xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata>
<xs:element name=”NewDataSet msdata:IsDataSet=”true msdata:MainDataTable=”julietable>
<xs:complexType>
<xs:choice minOccurs=”0 maxOccurs=”unbounded>
<xs:element name=”julietable>
<xs:complexType>
<xs:sequence>
  <xs:element name=”au_id type=”xs:string minOccurs=”0 />
  <xs:element name=”au_lname type=”xs:string minOccurs=”0 />
  <xs:element name=”au_fname type=”xs:string minOccurs=”0 />
  <xs:element name=”phone type=”xs:string minOccurs=”0 />
  <xs:element name=”address type=”xs:string minOccurs=”0 />
  <xs:element name=”city type=”xs:string minOccurs=”0 />
  <xs:element name=”state type=”xs:string minOccurs=”0 />
  <xs:element name=”zip type=”xs:string minOccurs=”0 />
  <xs:element name=”contract type=”xs:boolean minOccurs=”0 />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:choice>
  </xs:complexType>
  </xs:element>
  </xs:schema>
<diffgr:diffgram xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata xmlns:diffgr=”urn:schemas-microsoft-com:xml-diffgram-v1>
<DocumentElement xmlns=”>
<julietable diffgr:id=”julietable1 msdata:rowOrder=”0>
  <au_id>172-32-1176</au_id>
  <au_lname>White</au_lname>
  <au_fname>chris</au_fname>
  <phone>408 222-1229</phone>
  <address>10932 Bigge Rd.</address>
  <city>Menlo Park</city>
  <state>CA</state>
  <zip>94025</zip>
  <contract>true</contract>
  </julietable>
  </DocumentElement>
  </diffgr:diffgram>
  </DataTable>

————————

  <?xml version=”1.0″ encoding=”utf-8″ ?>
<DataSet xmlns=”http://tempuri.org/>
<xs:schema id=”NewDataSet xmlns=” xmlns:xs=”http://www.w3.org/2001/XMLSchema xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata>
<xs:element name=”NewDataSet msdata:IsDataSet=”true>
<xs:complexType>
<xs:choice minOccurs=”0 maxOccurs=”unbounded>
<xs:element name=”julietable>
<xs:complexType>
<xs:sequence>
  <xs:element name=”au_id type=”xs:string minOccurs=”0 />
  <xs:element name=”au_lname type=”xs:string minOccurs=”0 />
  <xs:element name=”au_fname type=”xs:string minOccurs=”0 />
  <xs:element name=”phone type=”xs:string minOccurs=”0 />
  <xs:element name=”address type=”xs:string minOccurs=”0 />
  <xs:element name=”city type=”xs:string minOccurs=”0 />
  <xs:element name=”state type=”xs:string minOccurs=”0 />
  <xs:element name=”zip type=”xs:string minOccurs=”0 />
  <xs:element name=”contract type=”xs:boolean minOccurs=”0 />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:choice>
  </xs:complexType>
  </xs:element>
  </xs:schema>
<diffgr:diffgram xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata xmlns:diffgr=”urn:schemas-microsoft-com:xml-diffgram-v1>
<NewDataSet xmlns=”>
<julietable diffgr:id=”julietable1 msdata:rowOrder=”0>
  <au_id>172-32-1176</au_id>
  <au_lname>White</au_lname>
  <au_fname>chris</au_fname>
  <phone>408 222-1229</phone>
  <address>10932 Bigge Rd.</address>
  <city>Menlo Park</city>
  <state>CA</state>
  <zip>94025</zip>
  <contract>true</contract>
  </julietable>
</NewDataSet>
  </diffgr:diffgram>
  </DataSet>

sometimes spam is downright funny

“You dont know me but my name is %TIF. My friend and I were at a party the other night and I saw you there. I really wanted to meet you that night, I thought you looked like a really nice guy and that you were good looking too 😛 I had to leave the party so I asked my friend to get your email address for me and she did. I would like to meet you. I hope to hear back from you 🙂 “

I look like a really nice guy, eh? Hmmm…

Considering the fact that I never cared about certifications…

…wouldn’t it make you laugh if you knew that I have been checking my transcript on the MCP site about 5 times a day to see if my Security exam (which I now have paper proof that I passed) has shown up yet and my certification has changed from “MCP” to “MCAD”.

If I cared, that is…

But since I have been a developer for 20 years and up until May had never taken even one test, obviously it’s not that important to me. 🙂

Cause of some “un-debuggable” errors in 3rd party components

I encountered an error when working with an Infragistics UltraWinGrid that I could not trap or debug. It was in using a dropdown in a cell, and the exception raised told me it could not update an invalid row. I spent over an hour trying to trap the error at its source so that I could fix it but was unable to.

Finally I discovered that this was actually an exception that is handled internally by the component, but because I had my debug Exceptions settings set to “break into the debugger” (for all exceptions) when an exception is thrown. When I set this back to “Continue”, I did not receive this error anymore.

I just spoke with someone who had the exact same problem (with the drop down in an Infra WInGrid). She too, had the exceptions turned to “break into the debugger” which was preventing the component from handling its error. As soon as she set this off, the exception disappeared.