Monthly Archives: February 2012

Navigate a Grid Using Combinations And Permutations

  The above from S to E through 8 short path so 8!. The width is 4! So (8!/4!). The height is also 4! So (short paths factorial / width factorial) / height factorial =(8!/4!)/4! = (40320/24)/24 = 70 Note: … Continue reading

Posted in Community, Computers and Internet | Tagged , , , | Leave a comment

How to create a set of square with the same weight and height in Microsoft word

The square below are all the same size. How to create a set of square with the same weight and height in Microsoft word

Posted in Community, Microsoft Office | Tagged | Leave a comment

Failed to retrieve data for this request Error 5120

You will see the following screen for the error above.   ========================================================================== TITLE: Microsoft SQL Server Management Studio ——————————   Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)   For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476   —————————— ADDITIONAL INFORMATION:   Unable to … Continue reading

Posted in .Net | Tagged | 3 Comments

How to enable SQL Server and Windows Authentication mode

1. Right click the SQL Server and choose properties. 2. Select Security. 3. Click on the SQL Server and Windows Authentication mode.   Watch the video below. How to enable SQL Server and Windows Authentication mode Resources: Enable SQL Server … Continue reading

Posted in .Net | Tagged | Leave a comment

How to update xml element

The original xml like below. <configuration>   <configSections>     <sectionname=“TestReadSection” type=“System.Configuration.NameValueSectionHandler“ />     <sectionname=“TestWriteSection” type=“System.Configuration.ClientSettingsSection“allowExeDefinition=“MachineToLocalUser“requirePermission=“false“ />   </configSections>   <TestReadSection>     <addkey=“ApplicationName” value=“Configuration Demo“ />   </TestReadSection>   <TestWriteSection>     <settingname=“ConnectionMachine” value=“nostring“>       <value>somevalue</value>     </setting>   </TestWriteSection> </configuration>   … Continue reading

Posted in .Net | Tagged , , | 1 Comment

How to return List from LINQ Query

There are quite a few way to cover LINQ query result to List. I do think the one below is the simplest. Normally you will have a LINQ statement returning like below. var result = from s in context.RSSes orderby … Continue reading

Posted in .Net | Tagged , , , | Leave a comment

How to sort by date using LINQ

Actually it is quite simple. All you need to do is using the orderby keyword. staticvoid Main(string[] args) {   MSNMalaysiaNewsEntities context = newMSNMalaysiaNewsEntities();     var result = from s in context.RSSes orderby s.PublishingDate select s;     foreach … Continue reading

Posted in .Net | Tagged , | 1 Comment