Monthly Archives: July 2012

Execute Python code using C#

In order to to run the Python code using C# you need to add reference   ·         IronPython ·         IronPython.Modules   You can get download this from http://ironpython.codeplex.com/.   You also need add Dynamic Language Runtime as reference ·         Microsoft.Dynamic … Continue reading

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

‘ProjectName.Program+Category’ was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation

If you follow the code from this blog http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-code-first-walkthrough.aspxthen you might hit the error “’ProjectName.Program+Category’ was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation.” I repeat the code … Continue reading

Posted in .Net | Tagged , | Leave a comment

‘DbContext’ could not be found (Code First)

When you want to use Code First feature in Visual Studio 11 or Entity Framework 4.1 then you might hit the error “‘DbContext’ could not be found”. If you are looking at the blog like http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-code-first-walkthrough.aspx you will wondering the … Continue reading

Posted in .Net | Tagged , , | 1 Comment

Write XML Tree to XML file (LINQ to XML)

When you read the article Creating XML Trees in C# (LINQ to XML), http://msdn.microsoft.com/en-us/library/bb387089.aspx, you will see the console output is   Child1 was cloned Child2 was attached   You will have a question on why it doesn’t look like … Continue reading

Posted in .Net | Tagged , | 2 Comments

Cannot send photo using Samsung Android phone

There is nothing to do with your phone like Samsung Ace but you need to 1. Press menu 2. Go to Settings 3. Press Wireless and networks 4. Press Mobile networks 5. Enable the Use packet data. Do disable it … Continue reading

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

Simple sample on Export to Excel using OpenXML SDK in ASP.NET

When you download the source code from http://www.codeproject.com/Tips/366446/Export-GridView-Data-to-Excel-using-OpenXml to try to Excel a single cell to Excel file it is just uneasy. I have broken a big chunk into a smaller unit to just output one value to an Excel … Continue reading

Posted in .Net | Tagged | 1 Comment

Simple way to get the DOM element by id using HtmlAgilityPack

The is a XMLDocument (serious I bet this is what they are using) wrapper in codeplex.com called HtmlAgilityPack. Somehow there is not easy to get the document even on how to use GetElementbyId method. The code below shows how to … Continue reading

Posted in .Net | Tagged , | 1 Comment