Showing posts with label .NET Solutions and Answer. Show all posts
Showing posts with label .NET Solutions and Answer. Show all posts

Friday, November 21, 2014

PowerShell Script for retrieving list of libraries from specific Site Collection

---Script to get libraries excluding documentlibrary----

$site = Get-SPSite '<>'
foreach ($web in $site.AllWebs)
{
  foreach ($list in $web.Lists)
   {
   if ( $list.BaseType -ne 'DocumentLibrary')
{
       write-host $list.title
 }
}
}
$web.dispose()

---Script to get libraries which are documentlibrary----

$site = Get-SPSite '<>'
foreach ($web in $site.AllWebs)
{
  foreach ($list in $web.Lists)
  {
  if ( $list.BaseType -eq 'DocumentLibrary')
{
       write-host $list.title
 }
}
}
$web.dispose()


Paste the below code in a file with ps1 as an extension(Ex:getlibrary.ps1) and execute the script in Management Shell as ".\filename.ps1" (Ex: .\getlibrary.ps1)

Wednesday, November 19, 2014

Learning SQL Server and PowerShell scripting

Good links for learning SQL Server and PowerShell.

SQL Server : http://visakhm.blogspot.in/ ,http://blog.sqlauthority.com/


PowerShell :http://www.ravichaganti.com




Wednesday, July 9, 2014

How to get wsp to your local box from the farm solution in Sharepoint?

When i started to work on Sharepoint,i came across an requirement stating to work on the wsp features which is placed in farm solution.As it is tedious job to look on each and every features in Central Administration,i thought of downloading the wsp onto my local box than i googled a lot to get below command which retrieves the particular wsp you need to your local box as follows:

Syntax:

$farm = Get-SPFarm
$file = $farm.Solutions.Item(f1).SolutionFile
$file.SaveAs(f2)


Note:
f1 - describes the name of the wsp.
f2 - which path the wsp should be saved in local box.



Example:
$farm = Get-SPFarm
$file = $farm.Solutions.Item(“metalogix.wsp”).SolutionFile
$file.SaveAs(“c:\WSP\metalogix.wsp”)

Monday, July 7, 2014

.NET Framework 3.5 installation in Server 2008R2 when needed

If you want to install .NET Framework 3.5 into your Server 2008R2,than you have to take help of role management tool.This can be seen in Server Manager. In Server Manager,expand Features and click on Add Feature which can be seen in the right most corner and in that check .NET Framework 3.5.1 feature and you are done. For reference please see the screenshot below..




Wednesday, July 2, 2014

What is ECB(Edit control block) in Sharepoint?

While reviewing some document,i came across the word ECB.I am very new to the technology and i don't the terminology what they are talking about.I searched in google and after lot of research i came to know that it is control which appears when you drag the pointer where the documents are present in the document library for example.The drop down it comes is sharepoint terminology called as ECB (Edit control block).If you want,you can customize the control by adding your text. Below is the url you can refer for example: http://www.thespgeek.com/2011/01/how-to-add-custom-menu-item-in.html

Tuesday, March 11, 2014

How to trouble shoot when we are unable to create web application in Central Administration of Sharepoint Farm 2010,due to some mismatch of Password?

The simple work around to stop rendering this error is: 1.Go to Security->General Settings->Configure managed Accounts. 2.In that edit your account by giving correct password and click ok. You are done.Now try to create a new web application. Happy Coding!!!!

What is trouble shoot if you are unable to open Sharepoint Farm or if the page is rendering 503 error code?

The work around for this is as follows: 1.We have to navigate to IIS under Administrative Tools in ControlPanel. 2.Than,we have to navigate to Application Pools->Sharepoint Central Administration v4.And click on Advanced Settings,a pop up will open in which you can view Identity under Process Model. 3.By clicking on the Identity,you can set your username and Password.After changing them,if you refresh the Sharepoint Page,you can view the page which the error won't be rendering again.

Wednesday, February 26, 2014

Keyboard Shortcuts (Microsoft Windows)


1. CTRL+C (Copy)
2. CTRL+X (Cut)
3. CTRL+V (Paste)
4. CTRL+Z (Undo)
5. DELETE (Delete)
6. SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
7. CTRL while dragging an item (Copy the selected item)
8. CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
9. F2 key (Rename the selected item)
10. CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
11. CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
12. CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
13. CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
14. CTRL+SHIFT with any of the arrow keys (Highlight a block of text)
SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
15. CTRL+A (Select all)
16. F3 key (Search for a file or a folder)
17. ALT+ENTER (View the properties for the selected item)
18. ALT+F4 (Close the active item, or quit the active program)
19. ALT+ENTER (Display the properties of the selected object)
20. ALT+SPACEBAR (Open the shortcut menu for the active window)
21. CTRL+F4 (Close the active document in programs that enable you to have multiple documents opensimultaneously)
22. ALT+TAB (Switch between the open items)
23. ALT+ESC (Cycle through items in the order that they had been opened)
24. F6 key (Cycle through the screen elements in a window or on the desktop)
25. F4 key (Display the Address bar list in My Computer or Windows Explorer)
26. SHIFT+F10 (Display the shortcut menu for the selected item)
27. ALT+SPACEBAR (Display the System menu for the active window)
28. CTRL+ESC (Display the Start menu)
29. ALT+Underlined letter in a menu name (Display the corresponding menu) Underlined letter in a command name on an open menu (Perform the corresponding command)
30. F10 key (Activate the menu bar in the active program)
31. RIGHT ARROW (Open the next menu to the right, or open a submenu)
32. LEFT ARROW (Open the next menu to the left, or close a submenu)
33. F5 key (Update the active window)
34. BACKSPACE (View the folder onelevel up in My Computer or Windows Explorer)
35. ESC (Cancel the current task)
36. SHIFT when you insert a CD-ROMinto the CD-ROM drive (Prevent the CD-ROM from automatically playing)
Dialog Box - Keyboard Shortcuts
1. CTRL+TAB (Move forward through the tabs)
2. CTRL+SHIFT+TAB (Move backward through the tabs)
3. TAB (Move forward through the options)
4. SHIFT+TAB (Move backward through the options)
5. ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
6. ENTER (Perform the command for the active option or button)
7. SPACEBAR (Select or clear the check box if the active option is a check box)
8. Arrow keys (Select a button if the active option is a group of option buttons)
9. F1 key (Display Help)
10. F4 key (Display the items in the active list)
11. BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

Microsoft Natural Keyboard Shortcuts
1. Windows Logo (Display or hide the Start menu)
2. Windows Logo+BREAK (Display the System Properties dialog box)
3. Windows Logo+D (Display the desktop)
4. Windows Logo+M (Minimize all of the windows)
5. Windows Logo+SHIFT+M (Restorethe minimized windows)
6. Windows Logo+E (Open My Computer)
7. Windows Logo+F (Search for a file or a folder)
8. CTRL+Windows Logo+F (Search for computers)
9. Windows Logo+F1 (Display Windows Help)
10. Windows Logo+ L (Lock the keyboard)
11. Windows Logo+R (Open the Run dialog box)
12. Windows Logo+U (Open Utility Manager)
13. Accessibility Keyboard Shortcuts
14. Right SHIFT for eight seconds (Switch FilterKeys either on or off)
15. Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
16. Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
17. SHIFT five times (Switch the StickyKeys either on or off)
18. NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
19. Windows Logo +U (Open Utility Manager)
20. Windows Explorer Keyboard Shortcuts
21. END (Display the bottom of the active window)
22. HOME (Display the top of the active window)
23. NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
24. NUM LOCK+Plus sign (+) (Display the contents of the selected folder)

MMC Console keyboard shortcuts

1. SHIFT+F10 (Display the Action shortcut menu for the selected item)
2. F1 key (Open the Help topic, if any, for the selected item)
3. F5 key (Update the content of all console windows)
4. CTRL+F10 (Maximize the active console window)
5. CTRL+F5 (Restore the active console window)
6. ALT+ENTER (Display the Properties dialog box, if any, for theselected item)
7. F2 key (Rename the selected item)
8. CTRL+F4 (Close the active console window. When a console has only one console window, this shortcut closes the console)

Remote Desktop Connection Navigation
1. CTRL+ALT+END (Open the Microsoft Windows NT Security dialog box)
2. ALT+PAGE UP (Switch between programs from left to right)
3. ALT+PAGE DOWN (Switch between programs from right to left)
4. ALT+INSERT (Cycle through the programs in most recently used order)
5. ALT+HOME (Display the Start menu)
6. CTRL+ALT+BREAK (Switch the client computer between a window and a full screen)
7. ALT+DELETE (Display the Windows menu)
8. CTRL+ALT+Minus sign (-) (Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PRINT SCREEN on a local computer.)
9. CTRL+ALT+Plus sign (+) (Place asnapshot of the entire client window area on the Terminal server clipboardand provide the same functionality aspressing ALT+PRINT SCREEN on a local computer.)

Microsoft Internet Explorer Keyboard Shortcuts
1. CTRL+B (Open the Organize Favorites dialog box)
2. CTRL+E (Open the Search bar)
3. CTRL+F (Start the Find utility)
4. CTRL+H (Open the History bar)
5. CTRL+I (Open the Favorites bar)
6. CTRL+L (Open the Open dialog box)
7. CTRL+N (Start another instance of the browser with the same Web address)
8. CTRL+O (Open the Open dialog box,the same as CTRL+L)
9. CTRL+P (Open the Print dialog box)
10. CTRL+R (Update the current Web page)
11. CTRL+W (Close the current window

Wednesday, January 8, 2014

Why Sharepoint and what is Sharepoint and what is the role of developers into this platform?

Sharepoint is used mostly for increasing the productivity of the organization,it gives one point of contact,where it enhances the collaboration within people to share and communicate. Sharepoint is a platform and not a new programming language.It is used for end user to share the documents within people in the organization,but for developers leverage,customize and taylor the requirements as per bussiness needs,to create intranet or extranet sites,sharepoint helps a lot. There are two types of Sharepoint: 1.Sharepoint Foundation.(free version) 2.Sharepoint Server 2010.(Paid version) Hardware Requirements and Software Requirements: 1.Atleast 4GB Ram. 2.80 GB hard disk. 3.64 bit compatible. 4.Windows Server 2008R2,64bit, IIS7.0. 5.SQLServer 2008 Enterprise/Edition. 6.ASP.NET 7.Sharepoint Foundation(core framework). 8.Sharepoint Server 2010. As Sharepoint has API object model and it consumes in VS,so developer can work accordingly to create sites as per the requirements.

Saturday, March 23, 2013

Want to create Multi Lingual for your website in .NET?

Good tutorial on Multi Lingual Site

http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-a-multi-lingual-site-with-localization

WCF Exam Material Preparation

For preparing WCF certification examination material:

http://www.jamesjfoster.com/blog/2010/resource-links-for-70-513-wcf-certification-exam/


Decode and Encode a String using C#.NET

using System;
using System.Data;
using System.Text;

protected void Page_Load(object sender,eventargs e)
{
     string convertString="Hello";
     string encodeString;
     byte[] a = Encoding.Default.GetBytes(encodeString);
     encodeString=Convert.ToBase64String(a, 0, a.Length);
     Response.Write("The Encode Value is:"+ encodeString);
     string decodeString;
     byte[] decValue = Convert.FromBase64String(ValueDecode);
     decodeString=Encoding.Default.GetString(decValue);  
    Response.Write("The Decode Value is:"+ decodeString);
}

Wednesday, February 13, 2013

Hide div tags with jQuery and javascript?


JavaScript function to hide div tag:

Code :

var varTag=document.getElementByTagName('div');

for(int i=0;i  varTag[i].style.display='none';


JQuery function to hide div tag:

Code:

$("div").hide();


Only with dollar sign($) and hide function () ,we are able to hide the div tag ..

Thursday, January 31, 2013

How to create a Custom model in MVC architecture?



1.Model can be written in any form that makes sense to your application.There is no constraints or                                                               requirements put on it by MVC.

2.If you want to share the same model with any application,you have the option of placing the model in App_Code directory or in any class library project.

Creating Custom Model:


public class CustomerModel
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string PostalCode { get; set; }
public string Phone { get; set; }

public static int Insert(Customer customer)
{
}
public static void Delete(int id)
{
}
public static void Update(Customer customer)
{
}
public static List GetAllCustomers()
{
}
public static Customer GetCustomer(int id)
{
}
}

Friday, October 5, 2012

Information regarding ITEXTSharp dll for operations or creation of PDF Documents

iTextsharp dll is a free library that helps us specially in creating and manipulating PDF documents. It is a wonderful free ware software for .NET and java to work on PDF documents.In order to use the dll,just browse in google with the name as "itextsharp.dll",you download it onto your machine and add it to bin folder of your respective web application,you are done.The itextsharp .dll contains all the integrated .NET classess in order to create or manipulate on the existing PDF.You can also find the related documentation in the google for itextsharp. dll.
 
 

Friday, December 9, 2011

Access Modifiers Understand thoroughly

Before going into access modifiers,one should remember that class by default are private,
if you not specify public modifiers before it.
Below are the access modifiers used in c#.net
1.Private
2.Public
3.Protected
4.Internal
5.Protected internal

1.Public modifiers can be used all the class or other class(within assembly or outside assembly).Simply in human language,getting valuable things from others,without a single penny :)

Ex:
public class A
{
public void Add()
{
}
}

2.Private modifiers can be used local to the class itself.In order to use them public
you have to use property like get,set

Ex:
public class b
{
int a; // default private members..
public int A
{
get
{
return a;
}
set
{
value=a;
}
}
}

Protected,Internal and Protected Internal members are as shown as below:

namespace AbstractDemo
{
public class TestModifiers
{

protected class protectedClassDemo
{
public static void PCD()
{
Console.WriteLine("This is protected class Demo:");
}
}
internal class internalClassDemo
{
public static void ICD()
{
Console.WriteLine("This is internal Class Demo:");

}
}
protected internal class ProtectedInternalClassDemo
{
public static void PICD()
{
Console.WriteLine("This is protected internal class demo:");
}
}
public class TTestModifiers
{
public void GetData()
{
TestModifiers.protectedClassDemo.PCD();
TestModifiers.internalClassDemo.ICD();
TestModifiers.ProtectedInternalClassDemo.PICD();
}

}
}
public class DTestModifiers
{
public void GetDataRead()
{
TestModifiers.internalClassDemo.ICD();
TestModifiers.ProtectedInternalClassDemo.PICD();
}

}
}


In short way:

Protected: Accessible-> within the class defined,but not accessible to different classes
defined in the same namespace and same assembly and accessible to different namespace or different assembly.

Internal:Accessible-> within the class defined and different class defined in same namespace or same assembly but not accessible to different namespace or different assembly.

protected internal:Accessible-> within the class defined and different classes defined
in the same namespace or different namespace or same assembly or different assembly.

Thursday, December 8, 2011

What is abstract with an example using Console Application in c#.net?

Abstract class:
When you want the class that doesn't create an object,than that class is declared with the modifier abstract,which contains non abstract method or abstract method(only structure is defined) and we have to implement in derived class.

Example:In Console Application

namespace Demo
{
class Demo:Operations
{
public static void Main(string []args)
{
Demo obj=new Demo();
obj.ReadOperations();
obj.add(4,5);
}
public override void add(int h,int g)
{
int c=h+g;
Console.WriteLine(c);
}
}
abstract class Operations
{
public abstract void add(int j,int k);
public void ReadOperations()
{
Console.WriteLine("Start Reading Operations:");
}
}

Output:
Start Reading Operations,
9.

Very Imp note:sealed,private,static,virtual(because implicity abstract is virtual),modifiers are not used while abstract keyword is used in class or in abstract methods.

Wednesday, October 12, 2011

Regular Expression for email validation

<asp:regularexpressionvalidator id="RegularExpressionValidator5" runat="server" controltovalidate="txtEmail"
errormessage="Please enter the valid Email ID" validationexpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
forecolor="#ececec" text="*"></asp:regularexpressionvalidator>