Last post Dec 24, 2010 04:38 AM by jayaprakash.mca
Dec 20, 2010 08:33 PM|MisterSnrub|LINK
My SelectCommand string in my asp:SqlDataSource is very long. Is there a way I can chop it up into different strings on several newlines to make it more readable?
Dec 20, 2010 11:42 PM|thuhue|LINK
Yes. Please post the said string for further help.
Dec 21, 2010 06:38 AM|MisterSnrub|LINK
SelectCommand="select a.node_name as node_name, b.domain_name as domain_name, b.set_name as set_name, b.class_name as class_name, b.defaultmc as defaultmc from nodes a left outer join mgmtclasses b on a.domain_name=b.domain_name where b.defaultmc='Yes'
and b.set_name<>'ACTIVE' "
Dec 24, 2010 02:43 AM|Wencui Qian - MSFT|LINK
In page code, you can easily seperate it to multiple lines. If you don't like it, you may set the select command in source code and as you know, a long string can be easily composed by some short strings like this:
string selectcomm = string1+string2+...;
Dec 24, 2010 04:38 AM|jayaprakash.mca|LINK
from the string and assign the string dynamically in the page load event/any other event applicable to you. like below
string strQuery="select a.node_name as node_name, b.domain_name as domain_name, b.set_name as set_name,"+
"b.class_name as class_name, b.defaultmc as defaultmc from nodes a left outer join mgmtclasses b " + "on a.domain_name=b.domain_name where b.defaultmc='Yes' and b.set_name<>'ACTIVE'";