Mike Taulty's Blog
Bits and Bytes from Microsoft UK

June 2008 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • Silverlight and ADO.NET Data Services ( 2 )

    Following on from this last post , if I start to edit the data in the grid and change some value then the property value will change in the underlying class but nothing else will happen. That is, the NorthwindEntities class which is managing my data for me client-side ( which is derived from DataServiceContext ) isn't going to be aware of those modifications. Why not? If we have a look at a property on a generated class such as this one for the CompanyName on the Customers class; public string CompanyName { get { return this ._CompanyName; } set { this .OnCompanyNameChanging( value ); this ._CompanyName = value ; this .OnCompanyNameChanged(); } } Now, OnCompanyNameChanging and OnCompanyNameChanged are partial methods with no implementation by default so nothing's going to happen when something like the DataGrid changes a value such as CompanyName. Similarly, the generated entity classes such as Customers do not implement INotifyPropertyChanged which means that changes in the data will not be reflected in the UI...
  • Silverlight and ADO.NET Data Services

    Someone mailed me to ask whether I had a video on how to put together Silverlight and ADO.NET Data Services. I don't at the time of writing and I've also got a cold right now ( thank you, Microsoft Manchester office :-) ) so I thought I'd write something rather than record it. Let's run through a step-by-step thing. Visual Studio 2008 - File->New->Web Site. I'm going for the filesystem and C# as below; Now, to make it easy to work with ADO.NET Data Services, I'm going to add in an ADO.NET Entity Data Model for Northwind. That is ... Website->Add->New Item; I say "yes" to add it to my app_code folder, then select; and then I can go and add a new ADO.NET Data Service ( again via Website->Add New Item ); and then I can update my service code to read; public class Service : DataService<NorthwindEntities> { // This method is called only once to initialize service-wide policies. public static void InitializeService(IDataServiceConfiguration config) { config.SetEntitySetAccessRule( "*" , EntitySetRights...
  • Entity Framework - Timestamps and Concurrency

    Someone asked me today how you'd go about ensuring that timestamp columns in your database tables show up in your Entity Framework EDMX file with a Concurrency=Fixed attribute on them. That is - it's very likely that the timestamps are there on the table to enforce concurrency so why not default their Concurrency value to "Fixed" ? It's a good question but it's not something that the tooling does as far as I'm aware so I tried to have together some LINQ to XML code that would make an attempt at it. I don't claim that this is correct at all but it might be a starting point for this and similar, related pre-processing that you want to do on an EDMX file. static void Main( string [] args) { XElement edmxFile = XElement.Load(args[0]); XNamespace edmxNs = XNamespace.Get( "http://schemas.microsoft.com/ado/2007/06/edmx" ); XNamespace ssdlNs = XNamespace.Get( "http://schemas.microsoft.com/ado/2006/04/edm/ssdl" ); XNamespace mapNs = XNamespace.Get( "urn:schemas-microsoft-com:windows:storage:mapping:CS" ); XNamespace csdlNs...
  • Michael Rys in London on Non-Relational Data in SQL Server

    The UK, SQL Server User Group has Michael Rys delivering a talk on Monday in London. Michael's a Program Manager in SQL Server. Go here for the details and to sign up. I don't know Michael personally but I know that back when I was looking at SQL Server 2005 and I asked any kind of question about the new XML data type it was more-often-than-not an email that came back from Michael with the answer in it so you should be in for a treat if you manage to get yourself signed up for this.
  • Silverlight - Dynamic DeepZoom with MultiScaleImage and MultiScaleTileSource

    One of the things that I've been meaning to experiment with around the MultiScaleImage control in Silverlight 2 Beta 2 was the ability of the control to request its image tiles from an alternate source. That is, in Silverlight 2 Beta 2 you can create your own type to provide tiled images; public class MyTileSource : MultiScaleTileSource { public MyTileSource( int imageWidth, int imageHeight, int tileSize) : base (imageWidth, imageHeight, tileSize, tileSize, 0) { this .tileSize = tileSize; this .imageWidth = imageWidth; this .imageHeight = imageHeight; } and then you can set this as the Source of a MultiScaleImage control as in; msi.Source = new MyTileSource( int .Parse(txtImageWidth.Text), int .Parse(txtImageHeight.Text), int .Parse(txtTileSize.Text)); and then the MultiScaleImage control will call your code when it wants to load up tiles. Now...in Silverlight 2 Beta 2 there's not so much that you can do around drawing bitmapped images. Joe Stegman has a sample here that does do dynamic image generation but he...
    Filed under: ,
  • Parallel Extensions for .NET

    I've been meaning to spend some time looking at the Parallel Extensions for .NET (PFX) for a little while but I've never quite managed to find that time. Last week, I managed to find a couple of hours on a train to have a poke around so I'm starting to write up the results of that here. Apologies if they're a bit of a "ramble". One of the reasons why I've been struggling to find time to look at PFX is that I'm a little unsure of what my view on it is. Some simple things; As far as I know, PFX is going to be part of the next version of the .NET Framework. It's currently in a June Preview which you can download from here You can watch Daniel's great "getting started" videos here although I suspect they might be a little out of date with respect to the June Preview. PFX is all part of the bigger Parallel Computing Platform initiative and there's an MSDN centre all about that up here and then the native side of development is surfacing here . Parallel FX is currently delivered in a single assembly, System.Threading...
    Filed under:
  • ACCU Talk on VS 2008

    I'm doing a talk down at ACCU this evening on VS 2008 and, specifically, as it's a short talk focusing on what I think is the biggest single thing in VS 2008 which is what changes around the languages and LINQ. The slides for the talk are here in PPTX , PPT and PDF formats.
  • Are you reading this from Microsoft UK?

    If you work for Microsoft in the UK then please click here and hit send from a recognisable email account. I'm curious as to how many people within the UK company read my blog. Thanks :-) Updated on 19th June to change the title and say that the current response rate is 22 people .
  • ADO.NET Data Services - IUpdatable on LINQ to SQL

    I made an attempt at implementing IUpdatable on the current (i.e. VS 2008 Sp1 B1) bits of ADO.NET Data Services. I struggled a little bit with this. When you produce a data service you provide a class which is derived from; DataService<T> and T might be your own custom type or it's more likely to be a class derived from DataContext ( LINQ to SQL ) or ObjectContext ( LINQ to Entities ). The framework reflects over the type that you provide as T in order to find public properties of type IQueryable<> and it can expose those ( if you tell it to ) as entity sets available over your service. If T is not an ObjectContext then the framework also looks to T to implement IUpdatable if you want to do read/write access to your data. It's extremely likely that if you're working with LINQ to SQL or LINQ to Entities then your type T will be the type that is generated from the tooling for you because that type already comes pre-populated with lots of IQueryable<> public properties nicely generated for you which...
  • ADO.NET Data Services and LINQ to SQL - Errors Generating Proxy Code with DataSvcUtil.exe

    Something that I came across today - if you're trying to surface a LINQ to SQL data source via the latest build of ADO.NET Data Services and you're running datasvcutil.exe on the metadata of the service then you might find yourself with a whole bunch of errors. Here's a sample of what I was getting this morning; error 7001: Schema specified is not valid. Errors: $metadata(0,0) : error 0005: The 'Namespace' attribute is invalid - The value '' is invalid according to its datatype ' http://schemas.microsoft.com/ado/2006/04/ edm:TNamespaceName' - The Pattern constraint failed. For me, I resolved this by just making sure that I revisited my DBML diagram for LINQ to SQL in Visual Studio and set the "Entity Namespace" property for code generation. That is, click on the white-space of the diagram; to make sure that you have the diagram rather than a particular entity set selected. Then hit F4 for the properties; and give yourself a namespace and all the errors seem to go away reasonably quickly :-)
  • Silverlight 2 Beta 2 - What's New?

    There's a great post up here from John Papa bringing together a number of "What's New" posts for SL 2, B2. http://johnpapa.net/all/silverlight-2-beta-2-rundown/ It lists the great resources from ScottGu, Tim Heuer, Shawn Wildermuth, Jesse Liberty, Steve White, Christian Schormann and the folks on the DataGrid and on Deep Zoom Composer. I just spent 30 mins or so reading every word of every post and watching some of the videos and they were all 100% a good use of time.
    Filed under: ,
  • Silverlight 2 Beta 2 Available plus Refreshed Screencasts

    Silverlight 2 Beta 2 is available - see http://www.silverlight.net for details on how to download it and for the list of breaking changes between Beta 1 and Beta 2. Here's where to get the runtime and the tooling ( SDK and Visual Studio ) Here's where to get Expression Blend 2.5 June CTP ( you're going to like this one if you've been hoping for template editing :-) ) Here's where to get the Deep Zoom Composer , or follow this link . You'll find that if you view your Silverlight Beta 1 applications with Silverlight Beta 2 then they won't display - you'll need to update those applications in order to work with Beta 2 and that is going to include rebuilding/reworking the code and changing the hosting page to request Beta 2. Mike and I made a bunch of videos for Silverlight Beta 1 and an application to display them. We've now updated those videos for Beta 2 and also ported the viewing application. I've removed the original player and the videos that it was displaying but the URL for the application remains the same...
  • Cube Desktop

    I've been using a 3D desktop manager for a little while now. It's called CubeDesktop . Today I got V1.3.2 and I feel I can finally write a little recommendation for this tool as, previously, I had a few issues that I think are going away ( if they've not gone completely ). I do quite a lot of talks in front of large groups and sometimes I'm lucky and have more than 1 PC to talk from and a fancy switching box which moves between those PCs. This means I can have a demo machine or two and a slide machine and it's lovely. More often though I have just the one machine. My laptop. HP NC 8430, 4GB RAM, 200GB 7200rpm disk, Core2 Duo T7400 processor and an ATI graphics card where the model number escapes me ( X1600? ). I don't have any other laptop which is often quite risky for bigger conferences as if this one breaks I've had it - hopefully one day someone will get me another laptop :-) When I'm working from one machine it's often quite nice to have a number of things set up on another desktop so that I can do something...
    Filed under:
  • The "To Do" List

    I watched the TechEd (US Developers) Keynote just yesterday. Tech·Ed NA Developers Keynote delivered by Bill Gates and you can see more on the TechEd Online site including a changing set of videos at the bottom of the page such as these ones which popped up when I visited the site; Which kind of freaked me out as I wasn't expecting to be greeted by my own ugly mug when hunting down resources from TechEd US ( that video is from TechEd Europe, you wouldn't believe how hard it is for someone like me to get to a conference like TechEd US ). During the keynote I started to get a little bit panicky. There's a lot of new stuff coming on top of all the new stuff that's already coming :-) I get a bit edgy when I know there's lots of new things around that I should probably know about but don't yet know about. Some of the things mentioned were a little less new than others but still pretty exciting. There was mention of Silverlight 2 Beta 2 of course and also some talk about the improvements to WPF in .NET Framework V3...
    Filed under:
1 2 Next >