Category Archives: Technical

Concentrates on .NET technologies and other misc. tech topics

SharePoint BDC Filter By

I wish I could filter by a predefined parameter but sharepoint doesnt allow me to do it out of the box.

After you set up your External content type like how you do normally, right click on the content type and click on ‘Export BDC Model’. After the model is exported, find the property enclosed in the tags “. This is your SQL query. Here you can do regular SQL queries with filters or parameters or date difference or whatever you want.

Once the changes are made go to the top of the file and edit the version number enclosed in the entity tags. Ex:

Create Site Collection with its own database

Creating Database:
New-SPContentDatabase -Name -WebApplication

Create Site Collection
New-SPSite -OwnerAlias -ContentDatabase -Name -Description -Template CMSPUBLISHING#0

Masking and Validations of HTML Elements using Jquery

This post will explain you how to do Masking and Validations using Jquery.

Masking:

using masking you can apply input masking to your input controls e.g. mask for SSN 111-11-1111

I have used the Jquery plugin called InputMak.

https://github.com/RobinHerbots/jquery.inputmask

Its important that you load all the plugin’s after Jquery has been loaded and make sure that Jquery is not loaded after plugins are loaded.

This will prevent the Object inputmask is not defined error in the javascript.

here are the examples that you apply a mask.

$(‘.cDate’).inputmask(“99/99/9999″);
$(‘.cPhone’).inputmask(“(999) 999-9999″);

Validations:

The application ‘/’ does not exist

Open command prompt and
c:\Windows\System32\Inetsrv\AppCmd.exe delete site “Site Name”

Force database from single user to multi user mode

select * from master.sys.sysprocesses
where spid>50 — don’t want system sessions
and dbid = DB_ID(‘Search_Service_Application_PropertyStoreDB_e9ad38de9ed543e88910e31c8c543bdb’)

use master
kill 118 — the connection to the database in single user mode
use [WSS_Search_SP-APP1]
alter database [WSS_Search_SP-APP1] set multi_user with rollback immediate

use master
kill 118 — the connection to the database in single user mode
alter database [WSS_Search_SP-APP1] set offline with rollback immediate
alter database [WSS_Search_SP-APP1] set online, multi_user with rollback immediate