Upgrade Web App from v3 to v.45 HTTP Error 500.22

Managed to successfully upgrade a Web Application from .Net Version 3 to Version 4.5 and I get the following error:-

HTTP Error 500.22 - Internal Server Error

As ASP.NET aspiration abortion setting has been detected abortion pill costs that does not apply in Integrated managed pipeline mode

Module: configurationValidationModule

Notification: BeginRequest

Handler: ExtensionlessUrlHandler-Integrated-4.0

Error Code: 0x80070032


Solution was quite simple and found it here:-

StackOverFlow - An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

Fix:-

In web.config add the following or make sure it exists:-

<configuration>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>
</configuration>

Using Telerik WPF RadWindow as MainWindow

Thought I would blog about how to use the Telerik abortion pill video WPF RadWindow as a MainWindow when using Visual Studio 2012 and .Net 4.5 (but I presume it will work with other versions).

So change the MainWindow.xaml from:-

<Window

to 

<telerik:RadWindow

Now this works fine but I notice that we have no taskbar icon, bit strange as this is default with the standard WPF form.  

To add this you will need a new reference:-

xmlns:navigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"

navigation:RadWindowInteropHelper.ShowInTaskbar="True"


Now we get the Taskbar icon back but it is the default WPF one so to add a custom one I added my own icon to a new Resource file and then referenced it:-

navigation:RadWindowInteropHelper.Icon="Resources/MyIcon.ico"


I also want how to get the pill the icon to show in the WPF window itself.  So I add the following:-

<telerik:RadWindow.Icon>

     <Image Source="Resources/MyIcon.ico" Height="18"/>

</telerik:RadWindow.Icon>


I also want to add a Telerik style to the whole form so I just add in:-

telerik:StyleManager.Theme="Windows7"

 

The complete code looks like:-

<telerik:RadWindow

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

    xmlns:navigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"

    x:Class="MyProject.MainWindow"

    telerik:StyleManager.Theme="Windows7"

    navigation:RadWindowInteropHelper.ShowInTaskbar="True"

    navigation:RadWindowInteropHelper.Icon="Resources/ReportsIcon.ico"

    Header="My Telerik Form">    

    <telerik:RadWindow.Icon>

        <Image Source="Resources/ReportsIcon.ico" Height="18"/>

    </telerik:RadWindow.Icon>

</telerik:RadWindow>

SQL70001 error on a Visual Studio Database Project

I had a Visual Studio 2012 Database Project along with my Visual Studio Asp.Net Project abortion trimester for storing my Stored Procedures in TFS.  However whenever I tried to Build my Project I kept getting Error 2 SQL70001: This statement is not recognized in this context.  I had made sure that my Database Project wasn't included in the build process so why was I getting these errors. on line abortion pill  I then took a look at the properties of the Stored Procedures and noticed the following:-

The Build Action was set to Build!

So the fix was fairly easy, just change to None:-

Unable to open Database Project in Visual Studio 2012

Installed SQL Server 2012 Management Studio on my local PC and found out in Visual Studio 2012 medical abortion pill I could no longer open a SQL Server Data Project.  I kept getting the following error "Unable to open Database Project" from SQL Server Data Tools and both web links failed to bring risk of abortion pill up and solutions (infact they just 404'd).

 

The fix was to install the SQL Server Data Tools - quite simple really?

http://msdn.microsoft.com/en-us/jj650015

Linq NullReferenceException on Where Clause

Had a strange error when running a similar query taking data from SQL Server:-

 var returnData = from selectedData in dataTable.AsEnumerable()

 where selectedData.Field<string>("ProductCategory").Trim().ToUpper() == all about abortion "CAT1"

 select selectedData

 

Error was:-

NullReferenceException abortion pill info was unhandled - Object reference not set to an instance of an object

And in debugger it was pointing to the where clause.  After lots of looking around it was because the field "ProductCategory" being returned from SQL Server was returning some nulls in the data.

The Fix:-

Use the ?? operator (see http://msdn.microsoft.com/en-us/library/ms173224.aspx)

var returnData = from selectedData in dataTable.AsEnumerable()

where (selectedData.Field<string>("ProductCategory") ?? "").Trim().ToUpper() == "CAT1"

select selectedData