Geeks With Blogs
Doug.Instance Improving the world one post at a time March 2011 Entries
Key to Strongly-Typed HtmlHelper Extensions in ASP.Net MVC2
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 ......

Posted On Friday, March 25, 2011 10:23 AM

Select Data From XML in MS SQL Server (T-SQL)
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 ......

Posted On Wednesday, March 16, 2011 8:31 AM

Copyright © Doug Lampe | Powered by: