Archive for the ‘.Net’ Category

List<Nullable<int>> custIDs = (from l in lookUpList 
                               group l by l.CustID into g
                               select g.Key).ToList<Nullable<int>>();
var customers=from c in new Repository().GetCustomers()
              where custIDs.Contains(c.CustID)
              select c).ToList();

Read Full Post »

List<Nullable<int>> custIDs = (from l in lookUpList                                          
                              select l.CustID).ToList<Nullable<int>>();
 var customers =from c in new Repository().GetCustomers()                                                
                where custIDs.Contains(c.CustID)                                                
                select c).ToList();

Read Full Post »

How to Create a Self Signed Certificate in IIS 7 on Windows Server

Installing an SSL Certificate in Windows Server 2008 (IIS 7.0)

Internet Information Services (IIS) Server Certificate Installation Instructions on development machine

makecert -sr LocalMachine -ss My -n CN=ServiceModelSamples-HTTPS-Server -sky exchange -sk ServiceModelSamples-HTTPS-Key

Source : http://msdn.microsoft.com/en-us/library/ms751408.aspx


Read Full Post »



The solution : http://social.msdn.microsoft.com/Forums/en/adodotnetdataservices/thread/f447c6df-6402-4a13-875c-925445fd7be8

Read Full Post »

A simple code snippet to demonstrate String to DateTime and DateTime to String conversions

     DateTime dt = DateTime.ParseExact("2010-05-21", "yyyy-MM-dd", null);

     Console.WriteLine(dt.ToLongDateString()); // Display the long date string
     Console.WriteLine(dt.ToString()); // Display the default date string
     Console.WriteLine(dt.ToShortDateString()); // Display the short date string

Source : http://www.codeproject.com/KB/cs/String2DateTime.aspx

Read Full Post »

            string path = @"c:\samplefile.txt";
            StreamReader streamReader = new StreamReader(path);
            string line=streamReader.ReadLine();
            while ( line!= null)
                line = streamReader.ReadLine();

Read Full Post »

Loading XML Document from a file.

XmlDocument doc = new XmlDocument();

Loading XML Document from string

string fileContent ="<Root><SomeNode>SomeValue</SomeNode></Root>";
XmlDocument doc = new XmlDocument();
TextReader rdr = new StringReader(fileContent);

Hope this help!

Read Full Post »

Older Posts »

%d bloggers like this: