GridView with DropDownList – Server tag is not well formed.

Ran across an issue today when trying to get my DropDownList embedded within a GridView.   Here is an extract of the code (the error is in the red text): <ItemTemplate>   <asp:DropDownList ID=”ddlMaker” runat=”server” DataSourceID=”odsMakers” DataTextField=”makerName” SelectedValue=”<%#Bind(“MakerID”) %>”   DataValueField=”makerID”>   </asp:DropDownList> </ItemTemplate> When I compiled I received an error “The server tag is not well formed.” After a bit … Read More

Creating Insert Statements for SQL Server

Ran across an interesting approach to generating insert statements for SQL Server 2005 (and other variants).  If uses a less well known function called master.dbo.fn_varbintohexstr. The approach that was taken was to use the fn_varbintohexstr function to encode the data so you did not need to use cursors or any fancy parsing to handle unicode and quotes in the generated … Read More

ASP.NET AJAX Control Toolkit Samples

Most of you probably have already experimented with the Control Toolkit, but just in case you never ran across it, take a look at these Toolkit samples If you have any questions about them, drop me a comment here.

Calculating Age in T-SQL

Here’s a decent article on calculating the age of a person (or anything else) written by Lynn Pettis.  Discusses some pitfalls with leap years.

Using and Managing SQL Server Aliases

I know that not many people I have met in my SQL Server experience have used SQL Aliases.  In many ways it is one of the most useful features of SQL Server.   Roman Rehak wrote a great article about SQL Server Aliases.  You have to be registered to see the full article, but some of the highlights are discussed below. … Read More

Resetting the IDENTITY counter in SQL Server T-SQL

You’ve been there before.  You are busily testing your import routines and running up the Identity column in your main import table.  Before you know it the value is in the multi-millions and you just want to reset it back to 1.  The way to accomplish this is to use the DBCC CHECKIDENT command. For example: DBCC CHECKIDENT (SalesForce, reseed, … Read More

Disabling buttons on click for ASP.NET forms

Found some great tips in the simple-talk.com blog about disabling buttons on asp.net forms. If you ever created a form and had your users click on the submit button multiple times this is the code you have been looking for.  Be sure to check out Robyn Page’s comments for a method to block the whole form during the form submit … Read More