Tag: CSharp
All the articles with the tag "CSharp".
-
PackageExplorer, not only great for OpenXML...
-
TFS Team Build and ASP.NET websites
Here's one I'd really like to share with everyone trying to build ASP.NET websites using TFS Build. First of all, a little story about the project setup... A VS2005 solution was created a few weeks ago. This solution included some projects, namely ASP.NET website, Domain Layer class library, Business Layer class library and DAL class library. The ASP.NET website uses project references to the class libraries, enabling automatic updates of all references on build. So far, so good. As a test case, this project was added to a new TFS project, and created a build for. That specific build kept failing forever, ignoring all tips I found on various websites.
-
Open XML Developer workshop content
Over the last few months, Doug, Wouter, Brian and lots of other people delivered a series of OpenXML workshops around the globe. Those who were there, and those who weren't, can now download all content of these workshops from OpenXMLdeveloper.org. There are some interesting slideshows available for those of you who never heared about OpenXML before, as well as some nice code samples to get you started developing in C# or Java. As a side note: I also spotted a good article on OpenXML, explaining the Open Packaging Conventions with a self-created file format (based on OpenXML).
-
NHibernate 1.2.0 - Unexpected row count: 0; expected: 1
Great... I've been working with NHibernate and MySQL for a while now, without having any strange problems. For a project I'm working on, I'm using SqlClient instead of MySQL now, and strangeness occurs. When I try to Flush() a NHibernate session, here's what is thrown: The problem seems to be a combination of things. First, there's my mapping file: [code:xml] <id name="Hash" column="hash_id" type="String"> <generator class="assigned"/> </id> [/code]
-
Enable sitemap security trimming in ASP.NET 2.0
Want to enable security trimming for your ASP.NET sitemap? Here's how... First of all, you need a new section in your web.config system.web element: [code:xml] <system.web> <!-- ... other system.web configuration stuff ... --> <siteMap defaultProvider="XmlSiteMapProvider" enabled="true"> <providers> <add name="XmlSiteMapProvider" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider " siteMapFile="Web.sitemap" securityTrimmingEnabled="true" /> </providers> </siteMap> </system.web> [/code] Next, you should specify which pages are visible to who: [code:xml]
-
ASP.NET URL rewrites using .htaccess-like syntax
Having a PHP background, I've been using .htaccess mod_rewrite in Apache for ages. ASP.NET allows rewriting too, but using a different syntax than mod_rewrite. Using the attached library, you can now use mod_rewrite syntax to perform rewrites on your ASP.NET application. Here's how... First of all, you need to download the attached library. Reference it from your web project, and register it as a module in Web.config, preferrably as the first one: [code:xml] <httpModules> <add name="UrlRewriter" type="MaartenBalliauw.UrlRewriter.Rewriter"/> <!-- Other modules can be put here... --> </httpModules> [/code] Second, create a file UrlRewriter.xml in the root of your web project, and add rewrite conditions in there: [code:xml]
-
Enlisting an ADO.NET command in an NHibernate transaction
For everyone who has read my article on NHibernate, here's a story for you... When building an application, everyone comes to a point where one needs to batch-update records in a database table, based on one or more criteria. Let's say, for example, there's a table "User" containing an activation date. And you want to remove all users that have activated in 1999. In a regular database environment, or when using ADO coding, one would write a DbCommand "DELETE FROM User WHERE activationdate < '2000-01-01'".
-
Commandline FTP folder download
A quick annoyed post... I just spent two hours searching the Internet for a means on how to recursively download a complete FTP folder, command-line, and in a simple way. Oh yeah, and preferably freeware. The solutions I found were not what I expected: a $50 software product providing a GUI (I said command-line! [:@]), a bloated scheduler thingy that does download in the background (I said simple! [8o|]), to batch-files relying on Windows built-in ftp.exe and a gigantic list of all files that need to be downloaded.
-
OpenXML news overview
A lot of news around OpenXML these days, so I decided to bundle some things into one big blog post. In .NET 3.0, there's the System.IO.Packaging API, which allows programmatic access to OpenXML packages (amongst them Office2007 files).Since this API is quite low-level, the Microsoft people introduced a new SDK built on top of System.IO.Packaging, which allows you to use strongly typed classes for document parts. Checkout a code sample on Wouter's blog and see for yourself: this SDK provides access to an OpenXML package in a much easier way than System.IO.Packaging. Download the SDK here.
-
MCTS for .NET framework 2.0 Web applications
Just like my colleague Kristof did last friday, I passed the Microsoft.NET Framework 2.0 - Web-based Client Development (Exam 070-528) exam yesterday, resulting in a new certification title: I’m now offically a Microsoft Certified Technology Specialist for .NET framework 2.0 Web applications.