Wednesday, October 22, 2014

SharePoint: The super user account utilized by the cache is not configured

SharePoint: The super user account utilized by the cache is not configured

=======================================
$w = Get-SPWebApplication "http://<server>/"
$w.Properties["portalsuperuseraccount"] = "domain\superuser"
$w.Properties["portalsuperreaderaccount"] = "domain\superreader"
$w.Update()
=======================================


Monday, September 22, 2014

SQL Delete All Records Except Top N Records

SQL : Delete All Records Except Top N Records 

-- Test Count Before Delete  :

Select count(Id) from [MyTable]

-- Delete All Records Except Top N Records :

DELETE FROM [MyTable] WHERE [Id] NOT IN (SELECT TOP 500 [Id] FROM [MyTable])

-- Test Count After Delete
Select count(Id) from [MyTable]

Tuesday, September 9, 2014

WPF ListView , GridView Select All CheckBox Operations Full Example (Multi Select)

WPF ListView , GridView Select All CheckBox Operations Full Example

Lately i'm working on developing tool to improve my work productivity using WPF (Windows Presentation Foundation)

And i encounter a problem that i want to use GridView with  Check Box on the Header to Select All Rows "Items"





XAML Code :


 <ListView  Name="lstgrd" SelectionMode="Multiple" Margin="10,10,10,0" SelectionChanged="lstgrd_SelectionChanged" MouseDoubleClick="lstgrd_MouseDoubleClick" ScrollViewer.VerticalScrollBarVisibility="Visible"  ScrollViewer.HorizontalScrollBarVisibility="Visible"  ScrollViewer.CanContentScroll="True"  HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="119.263">
            <ListView.View>
                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Authors">
                    <!-- Add a ContextMenu to GridView Header -->
                    <GridView.ColumnHeaderContextMenu>
                        <ContextMenu >
                            <MenuItem Header="Ascending" Click="MenuItem_Click" />
                            <MenuItem Header="Descending" />
                        </ContextMenu>
                    </GridView.ColumnHeaderContextMenu>
                    <!-- Add GridVeiw Columns -->
                    <GridViewColumn  Width="25">
                        <GridViewColumn.Header>
                            <CheckBox Name="chkWspSelectAll" HorizontalAlignment="Center" VerticalAlignment="Center" Checked="chkWspSelectAll_Checked"  Unchecked="chkWspSelectAll_Unchecked"  IsThreeState="False"/>
                        </GridViewColumn.Header>
                     
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox Name="chkWspSelect" IsChecked="{Binding Path=IsSelected}" HorizontalContentAlignment="Center"  HorizontalAlignment="Center" VerticalAlignment="Center" Checked="chkWspSelect_Checked"  Unchecked="chkWspSelect_Unchecked"  IsThreeState="False"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Name" Width="120" DisplayMemberBinding="{Binding Path=Name}" />
                    <GridViewColumn Header="Age" Width="50" DisplayMemberBinding="{Binding Path=Age}" />
                    <GridViewColumn Header="Mail" Width="150">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Mail}" TextDecorations="Underline" Foreground="Blue" Cursor="Hand" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>                  
                </GridView>
            </ListView.View>
        </ListView>


Sunday, June 8, 2014

While Installing Sharepoint : IIS7 deployment - duplicate 'system.web.extensions/scripting/scriptResourceHandler' section

While Install SharePoint :
IIS7 deployment - duplicate 'system.web.extensions/scripting/scriptResourceHandler' section


Reason :
Your Application Pool running in .net 4.0
These section definitions are already included in the root web.config in .NET 4.0
(%windir%\microsoft.net\framework\v4.0.30319\config\machine.config) that include all the system.web.extensions declared already.


Resolution :
- Cleanup your web.config that includes all the section Definitions that point to .net 3.5.
OR
- Change your application pool set to 2.0

Sunday, April 27, 2014

SharePoint: Retrieving the COM class factory for component with CLSID .. failed due to the following error: 80040154.

While Trying to use " SPSecurity.RunWithElevatedPrivileges " i get the following error :
"Retrieving the COM class factory for component with CLSID .. failed due to the following error: 80040154."



Solution :
- Right Click your Solution -> Properties -> Build Tab - >  PlatForm Target :  -> make it " Any CPU "






naadydev@gmail.com



Wednesday, April 23, 2014

iis Express : jquery getjson 404 Not found OR The page you are requesting cannot be served because of the extension configuration

iis Express : jquery getjson 404 Not found OR The page you are requesting cannot be served because of the extension configuration


Solution :
1- Right Click 0n iis Express -> Show All applications -> click your app
2- find the path of iis Express configuration file  something like -> C:\Users\<>\Documents\IISExpress\config\applicationhost.config


 3-  Inside : <staticContent> Tag -> Add :  <mimeMap fileExtension=".json" mimeType="application/json" />

4- Restart your IIS Express

naadydev@gmail.com
             

Monday, February 10, 2014

SQL Server : Create New Role for Execute Stored procedures Only





SQL Server : Create New Role for Execute Stored procedures Only
------------
/* Create a new role for executing stored
   procedures */
CREATE ROLE StoredExecutor

/* Grant stored procedure execute rights
   to the role */
GRANT EXECUTE TO StoredExecutor   -- OR  ->  GRANT EXECUTE ON SCHEMA::schema_name TO StoredExecutor

/* Add a user to the StoredExecutor role */
EXEC sp_addrolemember 'StoredExecutor', 'UserName'

================

naadyev@gmail.com

Sunday, February 2, 2014

FIX: SharePoint Designer The Server Could Not Complete Your Request

FIX: SharePoint Designer  The Server Could Not Complete Your Request

1- Open IIS  (Run -> inetmgr)
2- Select "SharePoint Web Services" and then click on "Authentication".
3- Enable "Anonymous Authentication"







naadydev@gmail.com