Dataset Not Well Formed Errors

Posted by Elliott Nash | Filed under

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” %>

Comments

November 24, 2009 21:02

Montgomery County Public Records

I don't really have a bunch to to say in reply, I just wanted to comment to reply great work. I genuinely loved your post. It looks like you've placed a lot of effort into your blog and this world require much more of these on the Internet these days.

Montgomery County Public Records

Comments are closed