While you can do most common tasks by simply passing expressions through to existing HtmlHelper extension methods, you may stumble on something where you want to evaluate the lambda expression on your own. While this may seem daunting at first, the MS folks have made it pretty simple. All you have to do is this: ModelMetadata modelMetaData = ModelMetadata.FromLambdaExp... htmlHelper.ViewData); This assumes that htmlHelper and epxression are parameters of your extension method which ......
So you have used XML to give you some schema flexibility in your database, but now you need to get some data out. What do you do? The solution is relatively simple: DECLARE @iDoc INT /* Stores a pointer to the XML document */ DECLARE @XML VARCHAR(MAX) /* Stores the content of the XML */ set @XML = (SELECT top 1 Xml_Column_Name FROM My_Table where Primary_Key_Column = 'Some Value') EXEC sp_xml_preparedocument @iDoc OUTPUT, @XML SELECT * FROM OPENXML(@iDoc,'/some/valid/... WITH (output_column1_name ......