Visual Studio “14” CTP 3 Released

Visual Studio 14 CTP 3 Released this week. More information here http://blogs.msdn.com/b/visualstudio/archive/2014/08/18/visual-studio-14-ctp-3-released.aspx. There is a new .NET Framework vNext. You cannot download the .NET Framework separately at this moment but to install Visual Studio 14 CTP 3.

For me, still using VS 14 CTP 2.

Posted in .Net | Tagged , | Leave a comment

Feature broken after install VS 14 CTP 2 with Visual Studio 2012

I have Visual Studio 2012, Visual Studio 2013 and Visual Studio 14 CTP 2. Today I realized that I can no longer create Entity Framework in Visual Studio 2012 but I can still do that in Visual Studio 2013.

Symptom: The Entity Data Model Wizard will pop up then disappear.  

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

3 Best Programming Practices

Recently I attended the online course provided by SkillSoft. One of the courses was Object-Oriented Programming Best Practices. I found there are 3 practices worth to be mentioned here.

1. Although you may provide your code in a clear, well organized format, and follow the best naming conventions, it is never possible to completely self-document your code. Therefore internal documentation a so should be provided, in addition to the self-documented code, in the form of comments. These comments are appended to the code they are documenting.  This internal documentation is the responsibility of individual software developers.

 InternetComment

2. A strongly typed variable is one that can only be of one type. This type is established at compile time and always associated with the variable. Strongly typed variables are more difficult to misuse. If you attempt to place a string in a strong y typed integer variable, this will produce a type error at compile time. If a strongly typed variable holds more than one type, type misuse is captured at runtime.

 StrongTyped

3. It is good practice to list the input parameters first, then the working parameters, and finally the output parameters, so that you can tell at a glance what the method does. An alternative is to have a consistent order for methods that use the same set of parameters. Either way, you should document the function of each parameter, and its assumptions, as you write the method.

documentParameter

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

Only one configSections element allowed per config file and if present must be the first child of the root configuration element

Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element

When you have custom section in app.config or web.config then you might hit the error “Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element”.

For example,

<configuration>

  <appSettings>

    <add key=CRMConnection value=http://atlabc/CRM13/XRMServices/2011/OrganizationData.svc//>

  </appSettings>

  <configSections>

    <!– For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 –>

    <section name=entityFramework type=System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 requirePermission=false />

  </configSections>

  <connectionStrings>

    <add name=PKG_CORPEntities connectionString=metadata=res://*/EDWModel.csdl|res://*/EDWModel.ssdl|res://*/EDWModel.msl;provider=System.Data.SqlClient;provider connection string=””&quot; providerName=System.Data.EntityClient />

  </connectionStrings>

</configuration>

 

When you need to do is to move your custom section such as appSettings below configSection then everything should be fine.

<configuration>

  <configSections>

    <!– For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 –>

    <section name=entityFramework type=System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 requirePermission=false />

  </configSections>

  <connectionStrings>

    <add name=PKG_CORPEntities connectionString=metadata=res://*/EDWModel.csdl|res://*/EDWModel.ssdl|res://*/EDWModel.msl;provider=System.Data.SqlClient;provider connection string=””&quot; providerName=System.Data.EntityClient />

  </connectionStrings>

 

  <appSettings>

    <add key=CRMConnection value=http://atlabc/CRM13/XRMServices/2011/OrganizationData.svc//>

  </appSettings>

 

</configuration>

Posted in .Net | Tagged , | Leave a comment

The Import Organization Wizard cannot connect to the SQL Server or cannot find an organization database on SomeMachineName. Verify that the server name in the SQL Server box is correct and that the computer is running Microsoft SQL Server where an organization database is stored

When you start you Microsoft Dynamics CRM Deployment Manager, choose Organizations then click Import Organization… You might hit the error “The Import Organization Wizard cannot connect to the SQL Server or cannot find an organization database on SomeMachineName. Verify that the server name in the SQL Server box is correct and that the computer is running Microsoft SQL Server where an organization database is stored.”

 ImportOrgError1

One of the reasons is you do not have the database that you want to import as organization prior to clicking the Import Organization…

See the example below, I must backup the CRM2013NN_MSCRM and restore using a different name, in my case CRM2013WIP_MSCRM. Bear in mind that the database name must append with _MSCRM.

 ImportOrgError2

You click the Import Organization…  again after the database restored then it should work.

ImportOrgError3

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

Visual Studio 2013 Update 3

I have done installation of Visual Studio 2013 Update 3. So far it is still not break…

 VS2013Update3

Download from msdn or here http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.

Posted in .Net | Tagged | Leave a comment

How do I create Query in Access 2013

After I read http://social.msdn.microsoft.com/Forums/en-US/60f55061-37f0-419d-914e-5ccbdf5941a8/4-access-tables-how-to-have-a-select-query-with-left-join-?forum=csharpgeneral in the forum. I think the easy way is to create a query in Access itself to test the query statement.

To create Query in Access 2013.

1. Click on the Create tab.

2. Choose either Query Wizard or Query Design.

 AccessQuery1

3. Once you choose the 2 tables, right click the join and select Join Properties.

 AccessQuery

You should be able to see the query return from your statement.

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