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

How to use ADO in native VC++

I have gotten this sample from CodeProject, ADO : 101-level tutorial. The sample is pretty straightforward if you are from VB6 time. The connection string looks very familiar as below. DemoAdo(“Provider=SQLOLEDB.1;Password=ma;Persist Security Info=True;User ID=sa;Initial Catalog=northwind;Data Source=.\\SQLEXPRESS”); Get the Recordset and … Continue reading

Posted in .Net | Tagged , | Leave a comment

Do use SkyDrive. Don’t send attachments.

Click below and see why The life of an attachment: complex, annoying, and time wasting!

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

Cannot drop KinectSkeletonViewer control to WPF Form

If you the sample from Quickstart slides and samplesfrom channel9 then you will have a sample called 5.Skeletal Tracking.  When you want to drop KinectSkeletonViewer (Microsoft.Samples.Kinect.WpfViewers) but you cannot.     Rename xmlns:my=”clr-namespace:Microsoft.Samples.Kinect.WpfViewers;assembly=Microsoft.Samples.Kinect.WpfViewers”   to xmlns:k=”clr-namespace:Microsoft.Samples.Kinect.WpfViewers;assembly=Microsoft.Samples.Kinect.WpfViewers”   You can also … Continue reading

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