Monday, January 1, 2018

SharePoint User Information List – URL

Following is the details of URL to get “User Information List”.

By using follwoing code, we can get the Users list url,

SPList userList = SPContext.Current.Web.SiteUserInfoList;
string url = userList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url;

the above code will return like the following url http://mysite/_layouts/userdisp.aspx. But, this url is not the exact url.

The actual url for “User Information List” available under _Catalogs folder, shown as below

http://mysite/_catalogs/users/detail.aspx
            Shows the detail view of only Users in the list.
http://mysite/_catalogs/users/simple.aspx
            Shows the simple view of only Users in the List
http://mysite/_catalogs/users/allgroups.aspx
            Shows all the groups without users available in Site.



Reference : site link

Saturday, November 18, 2017

Conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value

Solution:
"The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value" with Entity Framework when calling SaveChanges.

Go into your EDMX file, select the field that is causing the error and set StoreGeneratedPattern to Computed.








Add the DatabaseGenerated attribute if you are using EF Code First:

[DatabaseGenerated(DatabaseGeneratedOption.Computed)]

public Nullable<System.DateTime> Created { get; set; }

Tuesday, November 14, 2017

Clearing Your Browser Cache

Notes:
If you don't see instructions below for your specific version or browser, search your browser's Help menu for "clear cache". If you're unsure what browser version you're using, from the Help menu, select About [browser name]. In Internet Explorer and Firefox, if you don't see the menu bar, press and release Alt.
When troubleshooting issues with any web site, after clearing your browser's cache and cookies, exit your browser completely before attempting to access the site again. In Windows, close all your browser windows; in Mac OS X, quit (Command-q) your browser.

On this page:

About cache, cookies, and history
Android
Chrome
Firefox
Internet Explorer 9 and 8
Mobile Safari for iPhone OS (iPhone, iPod touch, iPad)
Safari

About cache, cookies, and history

Each time you access a file through your web browser, the browser caches (i.e., stores) it. By doing this, the browser doesn't have to retrieve files and images from the web site each time you click Back or Forward.

A cookie is a file created by a web browser, at the request of a web site, that is then stored on your computer. These files typically store user-specific information such as selections in a form, shopping cart contents, or authentication data.

A browser's history is a log of sites that you visit. When you press a browser's Back button, you are moving back one entry in the history log.

Android

Start your browser.
Tap Menu, and then tap More.
Select Settings.
Under "Privacy settings", select Clear cache, Clear history, or Clear all cookie data as appropriate, and then tap OK to accept (or Cancel to cancel) the deletion.

Chrome

In the browser bar, enter: chrome://settings/clearBrowserData
Select the items you want to clear (e.g., Clear browsing history, Clear download history, Empty the cache, Delete cookies and other site and plug-in data).
From the Obliterate the following items from: drop-down menu, you can choose the period of time for which you want to clear cached information. To clear your entire cache, select the beginning of time.
Click Clear browsing data.

Firefox

From the Tools or History menu, select Clear Recent History.
If the menu bar is hidden, press Alt to make it visible.
From the Time range to clear: drop-down menu, select the desired range; to clear your entire cache, select Everything.
Click the down arrow next to "Details" to choose which elements of the history to clear.
Click Clear Now.

Internet Explorer 9 and 8

Click Tools, and select Delete Browsing History... .
Deselect Preserve Favorites website data, and select Temporary Internet files, Cookies, and History.
Click Delete.

Mobile Safari for iPhone OS (iPhone, iPod touch, iPad)

To clear cache and cookies:
From the home screen, tap Settings, and then tap Safari.
At the bottom of Safari's settings screen, tap Clear cookies and data, or Clear Cookies and Clear Cache. Confirm when prompted.

To clear history:
From the home screen, tap Safari.
At the bottom of the screen, tap the Bookmarks icon.
In the lower left, tap Clear.
Tap Clear History.

Safari

From the Safari menu, select Reset Safari... .
From the menu, select the items you want to reset, and then click Reset. As of Safari 5.1, Remove all website data covers both cookies and cache.


Reference Site: https://mso.harvard.edu/sp_clear_cache

Tuesday, September 5, 2017

Quickly create a dynamic drop down list in Excel

I have a request from friend to create a dynamic drop down list in excel and I would like to share with my blog reader...

Part  1: 
- Open Excel and we start by creating a defined name, 
- Select the Formulas Tab, then Define
- Enter "SomeRangeName" under the Name text box
- Enter =OFFSET(sheet1!$B$2,0,0,COUNTA(sheet1!$B:$B),1) under the Refers to text box

Note: You have to enter drop down items in single column you want here in above formula I have selected Sheet1 and column B, it will start filtering from Row B2.

Part 2:
To create a data validation list:

- Select the cell you want to show dropdown list eg. A1
- Select Data Validation under the Data Tab
- Select List under Allow
- Place the cursor in the Source text box and type formula "=SomeRangeName"

That's it.. now when ever you add items in "Column B" it will automatically populate in drop down list... 

Tuesday, August 22, 2017

Getting Geo-location with JSon and JQuery


$.getJSON("https://freegeoip.net/json/", function(data) {
    const countryCode = data.country_code;
    const countryName = data.country_name;
    const ip = data.ip;
    const timezone = data.time_zone;
    const latitude = data.latitude;
    const longitude = data.longitude;

    alert("Country Code: " + countryCode);
    alert("Country Name: " + countryName);
    alert("IP: " + ip); 
    alert("Time Zone: " + timezone);
    alert("Latitude: " + latitude);
    alert("Longitude: " + longitude);   
});
Credit goes to original coder..

Friday, July 28, 2017

LoVe MessAges


Can I say I love you today? If not, can I ask you again tomorrow? And the day after tomorrow? And the day after that? Coz I'll be loving you every single day of my life.

When all seems lost and lonely for you
And you dont really know what to do
Look inside your heart and see
There in a special place, I will be

Most wonderful pairs in the world are:-
HEART & BEAT
NIGHT & MOON
BIRDS & SONGS
ROSES & LOVE
U & UR $MILE.
SO KEEP $MILING ALWAYS.

Being near is not the meaning of being dear,
I may be far from u but msgs are bridges
2 make u feel that I always REMEMBER YOU!

It is not being in love that makes me happy... but is being in love with YOU that makes me happy.

A sMiLe tO pUt You On HiGh... A KisS To Set YoUr SouL ALriGhT... WouLd iT bE aLriGhT iF I spEnT ToNiTe BeiNg LovED bY YoU???

Fate has brought us together, to meet, to know and to part is the saddest thing in life... I Love You...


Curved high on a mountain covered in dew... I saw these 3 words... I LOVE YOU!

Is that love i see in your eyes, or merely a reflection of mine?

I hide my tears when I say your name,
but the pain in my heart is stil the same.
Though I smile and seem carefree,
there's no one who misses you more than me!!

Friday, July 14, 2017

Compare the Contents of Two Folders in Windows

This is a common problem with us, while we take the backup. We always create duplicate backup of backup... mean multiple backup for the same files.. as we don't know if that is already there or not.. so this is just a little trick to save some space by avoiding duplicate.. 

List the folder structure using TREE command:
TREE command can be extremely handy in this case. Suppose you want to compare the two folders (including file names) c:\SOURCE and c:\DEST, open a Command Prompt window and then type these commands:

d:\> TREE  D:\SOURCE /A /F >D:\SOURCE.TXT

d:\> TREE  D:\DEST /A /F >D:\DEST.TXT

This outputs each of the command results to separate text files in your d:\ drive’s root directory. The text files will have your directory structure in a tree format, which makes it easy for comparison work.

Quick Tip: To compare only the directories, remove the "/F" flag.

Next, fire up your text comparison utility like WinDiff, WinMerge or DiffMerge. Don’t have any of those? No problem! You can compare the two text files online via diffchecker.com.

Go to DiffChecker.com and paste the contents of d:\source.txt in one column, and D:\DEST.txt in another column. Click Find differences.

Enjoy little trick to same space in your disk...