Saturday 13 July 2019

How to generate XML in SQL Server of table data?

We can generate xml schema of any table data in sql server in a very easy way.
for this sql server has provided XML PATH keyword.


after executing this you will get result in result window something like that

after clicking on blue content you can see that our XML has been generated.






Sunday 25 September 2016

Html.Partial() Vs Html.RenderPartial():-
Both of these helper methods used for rendering partial views.The following are the diffrences.

1.The return type of "RenderPartial" is void, where as "Partial" returns"MvcHtmlString".
2. Syntax for invoking Partial() and RenderPartial() methods in Razor views
@Html.Partial("NameOfPartialView")
{ Html.RenderPartial("NameOfPartialView");  }

When would you use Partial() or RenderPartial() ?
The main difference is that "RenderPartial()" returns void and the output will be written directly to the output stream, where as the "Partial()" method returns MvcHtmlString, which can be assigned to a variable and manipulate it if required. So, when there is a need to assign the output to a variable for manipulating it, then use Partial(), else useRenderPartial().

Which performance is better? 
From a performance perspective, rendering directly to the output stream is better.RenderPartial() does exactly the same thing and is better for performance overPartial().