Categories
Programming

The Configuration Section Cannot Contain a CDATA or Text Element

If you have a quick trawl for the error message “The configuration section cannot contain a CDATA or text element” you’ll find that currently there isn’t much solid advice for this error message. The good news is, it is usually quite simple. The most likely cause for this error message is that a rogue key-press […]

Categories
Programming

Remove Duplication From Your Web and App Config Files

Ever inherited a .NET app that has the database connection string in 30 different app.config and web.config files? How about one that also had the connection string in the connections string config section as well as the app settings config section. Well, even if it hasn’t been that bad for you – if you have […]

Categories
Programming

Adding an XML Attribute to a Node in a SQL XML Column

I’m not the world’s biggest fan of XML, but if you get locked in a room with a SQL Server XML column at a party, you need to make the best of it and start undoing buttons. So when you have an XML column, you have two parts to your SQL queries. The first part […]

Categories
Programming Visual Studio

How to Create Your Own Code Snippet in Visual Studio

I’m using Visual Studio 2012, but this works just as well in any sensibly modern version of Visual Studio. If you need to add an auto property in Visual Studio, you are probably aware of the “prop” snippet. Instead of typing: public string MyProperty { get; set; } You just type: prop And hit your […]