If you ever need to edit the commandtext attribute of the .Net dataset tag, you may well see the error message “The server tag is not well formed”.
The most probable cause for this error is the presence of single quotes in your query.
For example, the following code will not work:
CommandText=’<%# “SELECT substring(description, 0, CHARINDEX(’ ‘, description, 200)) as intro FROM products” %>’
luckily there is an easy way to get rid of this error. simply remove the outer single quotes surrounding the attribute:
CommandText=<%# “SELECT substring(description, 0, CHARINDEX(’ ‘, description, 200)) as intro FROM products” %>