Onteora Software

Ken Tucker's Blog
posts - 145, comments - 623, trackbacks - 0

June 2008 Entries

Linq 2 entities and XML

When using Linq 2 Sql with Linq to Xml in VB you could write code like this to generate xml   Dim db As New NorthwindDataContext  Dim xmlLinq2Sql = <root><%= From emp In db.Employees _                            Select <Employee id=<%= emp.EmployeeID %>><%= emp.FirstName & " " & emp.LastName %>                                   </Employee> %>                  </root>   Which will generate xml  like this <root>  <Employee id="1">Nancy Davolio</Employee>  <Employee id="2">Andrew Fuller</Employee>  <Employee id="3">Janet Leverling</Employee>  <Employee id="4">Margaret Peacock</Employee>  <Employee id="5">Steven Buchanan</Employee>  <Employee id="6">Michael Suyama</Employee>  <Employee id="7">Robert King</Employee>  <Employee id="8">Laura Callahan</Employee>  <Employee id="9">Anne Dodsworth</Employee></root>   The entity framework requires a more explicit format for the query   Dim...

posted @ Monday, June 30, 2008 12:58 AM | Feedback (3) |

Silverlight 2 Beta 2 VB only bug

           I have been playing around trying to use a wcf service with a vb silverlight 2 beta 2 app and kept getting a InvalidOperationException when trying to call the wcf service (of course it works fine in c#).  Tim Anderson's blog correctly shows all you have to do is give the contract a fully qualified namespace to fix the issue.    http://www.itwriting.com/blog/?p=666    So in a nut shell vb generates this in ServiceReferences.ClientConfig          <client>            <endpoint address="http://localhost:1735/Service1.svc" binding="basicHttpBinding"                bindingConfiguration="BasicHttpBinding_IService11" contract="ServiceReference1.IService1"                name="BasicHttpBinding_IService1" />         </client> When it should be          <client>            <endpoint address="http://localhost:1735/Service1.svc" binding="basicHttpBinding"                bindingConfiguration="BasicHttpBinding_IService11" contract="VBSqlData.ServiceReference1.IService1"                name="BasicHttpBinding_IService1" />        </client>  

posted @ Sunday, June 15, 2008 11:23 PM | Feedback (1) |

Powered by: