mm:dataset not well formed errors
if you are using dreamweaver mx to code asp.net applications you will probably be using a lot of mm:dataset tags. if you ever need to edit the commandtext attribute of the mm:dataset tag, you may well see the charming error message “The server tag is not well formed”.
one possible reason 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” %>



March 10th, 2005 at 7:25 am
Wow! This tip is amazing. I was almost ready to abandon using the MM:DataSet altogether (and hand coding it). Whew! It was so hard to find info or documentation on how to alter their tags!
(I guess Dreamweaver does this so that it will be harder for hackers to enter single quotes into querries because of injection attacks? Who knows…)
March 10th, 2005 at 7:27 am
BTW, while posting here I got this error
Use of uninitialized value in substitution (s///) at plugins/Blacklist/lib/Blacklist/App.pm line 44.
March 10th, 2005 at 9:00 am
hi mornington,
thanks for letting me know about this. your comment got through ok but was not instantly approved due to how old this post was. my anti-spam plugin clearly needs some tweaking to stop the pesky error messages though!
March 12th, 2005 at 12:06 pm
The post might be old, but who would have thought that almost a year later this tip would still be helping total strangers! Cool!
March 12th, 2005 at 12:25 pm
ah, it’s not that deep an insight or anything but thanks for saying thanks
it’s nice that almost a year later someone left a comment to say i helped a little
January 27th, 2006 at 3:52 pm
The solution helped me too – VisualStudio 2005 – Jan2006. Thanks
April 15th, 2006 at 8:28 am
you just made me a VERY happy man. HOURS and HOURS of frustration due to stupid little single quotes… who’da thunk?
June 22nd, 2007 at 12:31 pm
I like it thanks
September 5th, 2007 at 2:36 pm
Awesome…sorted me out a treat!
February 5th, 2008 at 12:17 pm
This same error will happen if you have runat=”server” inside a comment.
July 22nd, 2008 at 3:43 pm
Thanks a lot JM……. Ur tip saved my soul…
July 24th, 2008 at 11:08 am
This helped me as well .. VS 2008 – July 08!!
May 12th, 2009 at 2:58 pm
Thanks a lot, this was driving me crazy (I actually had the problem in an image control setting the AlternateText property)
I can’t believe this was the problem
September 14th, 2009 at 10:29 pm
Worked for two hours on this issue until I found this page – wow, can’t believe it – thank you!
October 5th, 2009 at 2:28 pm
Mega Thumbs up for this tip… I’ve been working in .NET for 10 years and this issue just comes up again and again…. Thanks!
June 17th, 2010 at 1:40 pm
Thanks JM – you saved me,too re runat