Friday, 27 February 2015

Difference between properties and attributes

The Difference between an Attribute and a Property To add or provide an additional perspective;
An Attribute is a descriptor of the Class (Class as opposed to instances or objects of the class) and are common/exists in, and of, all created instances of the class
whereas
A Property offers variance among instances/objects of the class.
For example, use an automobile as the class and think of different instances of an automobile:
Attributes: (these exist in all instances/cars)
1. 4 Wheels (hopefully!)
2. Headlights
3. Engine
4. Seats
Properties: (these allow variances in each instance/object)
1. Color [ Blue | Red | Grey ]
2. Rear Spoiler [ True | False ]
3. Engine Bore [ 5.7L | 5.0L ]
4. Seat Style: [ Leather | Cloth | Vinyl ]

Wednesday, 25 February 2015

XML Schema Definition Tool (Xsd.exe)

Create any XML
Generate xsd using xml. Rfe: http://www.freeformatter.com/xsd-generator.html#ad-output
Now open Visual Studio Command Prompt 2010 Administration mode.
Type xsd
you should get all help..
C:\WINDOWS\system32>xsd C:\Users\Admin\Documents\Test\My.xsd /c /out:C:\Users\Admin\Documents\Test

Outlook Backup

  • Click the File tab.
  • In the Outlook Options window, click Advanced.
  • Click Export.
  • In the Import and Export Wizard, click Export to a file, and then click Next.
  • Click Outlook Data File (.pst), and then click Next.
  • Select the folder to export, and then click Next.
  • Click Browse, and then select the location where you want the new .pst file to be saved.
  • In the File Name box, type the name that you want to use for the new .pst file, and then click OK.
  • Click Finish

Monday, 23 February 2015

C# XML Serialization and Deserialization

1.Create a Asp.Net web application.
2.Add a web page.
3.Add new xml file.
<?xml version="1.0" encoding="utf-8"?>
<CarCollection>
<Cars>
<Car>
<StockNumber>1020</StockNumber>
<Make>Nissan</Make>
<Model>Sentra</Model>
</Car>
<Car>
<StockNumber>1010</StockNumber>
<Make>Toyota</Make>
<Model>Corolla</Model>
</Car>
<Car>
<StockNumber>1111</StockNumber>
<Make>Honda</Make>
<Model>Accord</Model>
</Car>
</Cars>
</CarCollection>
Add above code in xml.
Now generate methods and properties for xml file using XML Schema Definition Tool (Xsd.exe)
Now open Visual Studio Command Prompt 2010 Administration mode.
Type xsd
you should get all help..
Generate the xsd file from xml, using below command.
C:\WINDOWS\system32>xsd C:\Users\Admin\Documents\Test\MyCars.xml
Generate the C# class file using below command.
C:\WINDOWS\system32>xsd C:\Users\Admin\Documents\Test\MyCars.xsd /c /out:C:\Users\Admin\Documents\Test
You will get MyCars.cs file under C:\Users\Admin\Documents\Test
Add MyCars.cs to your solution.
Build..should be no errors
In the webpage add button under button click write below code..
protected void btnCar_Click(object sender, EventArgs e)
{
CarCollection cars = null;
string path = "C:\\Users\\Admin\\Documents\\Visual Studio 2013\\Projects\\Testxml\\Testxml\\MyCars.xml";
XmlSerializer serializer = new XmlSerializer(typeof(CarCollection));
StreamReader reader = new StreamReader(path);
cars = (CarCollection)serializer.Deserialize(reader);
string strModel = cars.Items[0].Car[0].Model;
//You can read all properties....using for loop
//Start
CarCollection myCars = null;
using (XmlReader myReader = XmlReader.Create(path))
{
myCars = (CarCollection)serializer.Deserialize(myReader);
}
//End
}

Full code.....


Bulk File name change using powershell

First create ps.ps1 file and add below code.
Get-ChildItem -Filter "*New*" -Recurse | Rename-Item -NewName {$_.name -replace 'New','ooo' }
Now create a filenamechange.bat
add below code.
Powershell.exe -executionpolicy remotesigned -File  C:\Users\Admin\Documents\Test\ps.ps1
Now place 2 above files and your source files under C:\Users\Admin\Documents\Test
Run batch file.

Monday, 9 February 2015

K2 for SharePoint Tutorials: Expense Claim Approval Build


https://www.youtube.com/watch?v=wKDwTdaqF0A#t=13
https://www.youtube.com/watch?v=Osi0KZYaNvY
https://www.youtube.com/watch?v=svgcXXjXZeY
https://www.youtube.com/watch?v=veKKjJoUhuc
https://www.youtube.com/watch?v=y9uBxcZhVH8
https://www.youtube.com/watch?v=9bT6vpDO02M
https://www.youtube.com/watch?v=KhKhyX7WYAI

https://www.youtube.com/channel/UCe_842WPzxlDKgxquIa-eKg