Geeks With Blogs
Deeksha Sharma April 2014 Entries
De-Serialization in C#
XML Deserialization in C#.NetWhat is De-Serialization?From previous article we know that Serialization is the process of converting an object into a stream so that it can be saved in any physical file like (XML) or can be saved in Database. The main purpose of Serialization in C# is to persist an object and save it in any specified storage medium like stream, physical file or DataBase. Deserialization is vice-versa of Serialization. Deserialization is the opposite process of serizalization in which ......

Posted On Sunday, April 27, 2014 1:10 AM

Xml Serialization in c#
As name suggests, a serialization technique in which an object will be converted/saved into xml format or stream. To use serialization in xmlwe need XmlSerializer class. This class is derived fromSystem.Xml.Serialization. Serialize and Deserialize are the two most important methods that we use to serialize object to xml and then again deserialize into object. Things to remember while using xml serialization and deserialization in c# -Only public objects can be serialized in XML serialization. And ......

Posted On Sunday, April 27, 2014 1:09 AM

Send Mail in C#
Add Namespace:- using System.Net.Mail;then add this code\using System;using System.Collections.Generic;... System.Linq;using System.Text;using System.Net.Mail;namespace SendMail{ class Program { static void Main(string[] args) { Program p = new Program(); p.SendMail(); } public void SendMail() { try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("deeksha.sharma... mail.To.Add("sandeepkaushal... ......

Posted On Sunday, April 27, 2014 12:45 AM

Use of dictionary
Dictionary<string,decima... dictionaryobj = new Dictionary<string, decimal>();string [] text= System.IO.File.ReadAllLines... foreach(var line in text) { string[] result=line.Split('='); string first=result[0]; decimal second=Convert.ToDecimal(re... dictionaryobj.Add(first,sec... (KeyValuePair<string, decimal> obj in dictionaryobj) { price= obj.Value; } if(dictionaryobj.Keys.Where... => key.Contains("salesprice"))... { var keysales= dictionaryobj.Keys.Where(key ......

Posted On Wednesday, April 23, 2014 3:37 AM

Best Link for Dotnet Framework video session
http://mottishaked.com/training/dot-net-tutorial

Posted On Monday, April 14, 2014 6:30 AM

c# Excel reading
First ,we need to add the reference of Microsoft.Office.Interop.Excel by clicking right to Reference and add reference of it.after that just put the given code in our console application class. class ReadExcel { private string folderPath; public ReadExcel() { folderPath = ConfigurationManager.AppSet... } public void ReadFile() { DirectoryInfo directoryInfo = new DirectoryInfo(folderPath); FileInfo[] baseFilesInfo = directoryInfo.GetFiles("*.x... Trace.TraceInformation("Beg... ......

Posted On Thursday, April 10, 2014 6:17 AM

Log4Net Best LInks for reading
http://stackoverflow.com/qu... is a port of the popular log4J liberary used in Java.Try to use Nuget Packages for adding reference of Log4Net in your project.Install-Package log4net.These loggers provide 5 levels of logging:DebugInformationWar... ......

Posted On Thursday, April 10, 2014 6:13 AM

Key Points for Private Constructor
one use of private construct is when we have only static member.It provide implementation of singleton class patternOnce we provide constructor (private/public/any) the compiler will not add the no parameter public constructor to any class.If we still want to make object of the class having private constructor. We can have a set of public constructor along with the private constructor ......

Posted On Monday, April 7, 2014 5:29 AM

Difference Between Function and Stored procedure
Basic DifferenceFunction must return a value but in Stored Procedure it is optional( Procedure can return zero or n values).Functions can have only input parameters for it whereas Procedures can have input/output parameters .Function takes one input parameter it is mandatory but Stored Procedure may take o to n input parameters..Functions can be called from Procedure whereas Procedures cannot be called from Function.Advance DifferenceProcedure allows SELECT as well as DML(INSERT/UPDATE/DELETE) statement ......

Posted On Wednesday, April 2, 2014 9:16 AM

Difference between Interface and Abstract Class
OOPs interface vs abstract classInterfaceAbstract classInterface support multiple inheritanceAbstract class does not support multiple inheritanceInterface does'n Contains Data MemberAbstract class contains Data MemberInterface does'n contains CunstructorsAbstract class contains CunstructorsAn interface Contains only incomplete member (signature of member)An abstract class Contains both incomplete (abstract) and complete memberAn interface cannot have access modifiers by default everything is assumed ......

Posted On Wednesday, April 2, 2014 9:11 AM

Copyright © Deeksha Sharma | Powered by: GeeksWithBlogs.net