• ADO.NET 2.0 TableAdapters

    I’m starting to get my head around some of the new features of .NET 2.0. One that I’m finding quite useful is the generated TableAdapters that are part of the new DataSet designer.

    One situation I’ve just come across is the idea of having a “CREATED” and “MODIFIED” column for all tables to assist in auditing. By default, the code generated for the TableAdapter will try to insert and update these columns. But we want these columns to be only modified by triggers inside the database itself! So how to you modify the TableAdapter to read but not update these special columns?

    TableAdapter and Properties WindowIt turns out you can right-click on the TableAdapter heading to modify it’s properties, including the InsertCommand and UpdateCommand.

    Another way you can extend the TableAdapter is through partial classes.

  • LUA VS.NET issues

    We’ve got this problem where a few of us are trying to create new ASP.NET applications on our development server, and are getting the the following error message:

    Microsoft Development Environment The Web was created successfully, but an error occurred when trying to configure the application root for this Web. Web projects may not operate correctly without an application root. The returned error was: Active Directory Services cannot find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. The usual cause for this error is creating Web projects on a Windows 2000 or newer server from a Windows NT 4.0 client. You can manually configure the application root using the Internet Services Manager.

    Followed by:

    Microsoft Development Environment Unable to set the permissions on the 'bin' folder to restrict browse access. Active Directory Services cannot find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. The usual cause for this error is creating Web projects on a Windows 2000 or newer server from a Windows NT 4.0 client. You can manually restrict browse access to this folder using the Internet Services Manager.

    The workaround that we’re using (adapted from https://support.microsoft.com/en-us/help/320451 - broken link) is to set Visual Studio.NET to default to use FrontPage Server Extensions. Once a project is created, you can then change it back to use File Share access.

  • PageMethods - Type checking for your ASP.NET urls

    Here’s an interesting idea - setting up special methods in your ASP.NET page class to assist in generating URLS to that page. Versions for Visual Studio.NET 2003 and 2005.

    PageMethods takes care of your URLs. It proposes a solution to define structured URLs for each of your pages, as well as a clean and simple way to call them.

    The idea is based on strict page inputs and declarative parameter binding. With PageMethods, each page exposes a set of methods that represent the different ways to call the page. All you have to do to start benefiting from sharp URLs is to add methods to your pages, and mark these methods with attributes provided by PageMethods.