<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Binding Silverlight</title>
	<atom:link href="http://bimawen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bimawen.wordpress.com</link>
	<description>_ Underneath the Mountain</description>
	<lastBuildDate>Wed, 24 Mar 2010 00:54:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bimawen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/7fb94bc3530e73104c244d82cfed0aae?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Binding Silverlight</title>
		<link>http://bimawen.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bimawen.wordpress.com/osd.xml" title="Binding Silverlight" />
	<atom:link rel='hub' href='http://bimawen.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SilverlightBinding.com</title>
		<link>http://bimawen.wordpress.com/2010/03/23/silverlightbinding-com/</link>
		<comments>http://bimawen.wordpress.com/2010/03/23/silverlightbinding-com/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 00:46:18 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=1023</guid>
		<description><![CDATA[I moved to SilverlightBinding.com for a while for building an asp.net application to hold Silverlight information. If you are interested at Silverlight technology, that would be a good place to go.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=1023&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I moved to <a href="http://www.silverlightbinding.com">SilverlightBinding.com</a> for a while for building an asp.net application to hold Silverlight information. If you are interested at Silverlight technology, that would be a good place to go.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/1023/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=1023&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2010/03/23/silverlightbinding-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>select multiple dates in CalendarExtender of AJAX Control Toolkit</title>
		<link>http://bimawen.wordpress.com/2009/10/15/select-multiple-dates-in-calendarextender/</link>
		<comments>http://bimawen.wordpress.com/2009/10/15/select-multiple-dates-in-calendarextender/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 04:00:25 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Simple Sample]]></category>
		<category><![CDATA[Ajax Control Toolkit]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=1009</guid>
		<description><![CDATA[CalendarExtender of AJAX Control Toolkit (for now, ver 30390) has not a default feature to pick up multiple dates.  Vince Xu of MSFT gave an answer in asp.net forum. It helps me much. But, there are some issues in his sample code. if clean up the TextBox1 and then add a new date, the old [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=1009&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>CalendarExtender of AJAX Control Toolkit (for now, ver 30390) has not a default feature to pick up multiple dates.  <a href="http://forums.asp.net/members/Vince-Xu-_2D00_-MSFT.aspx" target="_blank">Vince Xu</a> of MSFT gave an answer in <a href="http://forums.asp.net/p/1357129/2788526.aspx" target="_blank">asp.net forum</a>. It helps me much. But, there are some issues in his sample code.</p>
<ol>
<li>if clean up the TextBox1 and then add a new date, the old text of TextBox1 will show up again in the textBox1, because the HiddenField1 is not cleaned up at all.</li>
<li>The &#8220;Done&#8221; button seems not reasonal. But, without the &#8220;done&#8221; button, the opened calendar could not be hidden forever.</li>
</ol>
<p>I fixed them by making a little change. Here is the code sample:</p>
<p>&lt;ajaxToolkit:ToolkitScriptManager runat=&#8221;Server&#8221; EnablePartialRendering=&#8221;true&#8221; ID=&#8221;ScriptManager1&#8243; /&gt;</p>
<p>&lt;asp:TextBox ID=&#8221;TextBox1&#8243; runat=&#8221;server&#8221;  &gt;&lt;/asp:TextBox&gt;</p>
<p>&lt;ajaxToolkit:CalendarExtender ID=&#8221;calendar1&#8243; runat=&#8221;Server&#8221; BehaviorID=&#8221;Calendar1&#8243;<br />
TargetControlID=&#8221;TextBox1&#8243;<br />
OnClientDateSelectionChanged=&#8221;dateselect&#8221; OnClientHidden=&#8221;calendarhidden&#8221; OnClientShown=&#8221;setInitialValue&#8221; /&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
var tmpDates = &#8220;&#8221;;</p>
<p>function setInitialValue() {<br />
tmpDates = $get(&#8216;&lt;%=TextBox1.ClientID %&gt;&#8217;).value;<br />
}<br />
function dateselect(ev) {<br />
var calendarBehavior1 = $find(&#8220;Calendar1&#8243;);<br />
var date = calendarBehavior1._selectedDate.format(&#8220;M/dd/yyyy&#8221;);<br />
if (tmpDates.indexOf(date) &lt; 0) {<br />
if (tmpDates != &#8220;&#8221;) { $get(&#8216;&lt;%=TextBox1.ClientID %&gt;&#8217;).value = tmpDates + &#8220;,&#8221; + date; }<br />
else { $get(&#8216;&lt;%=TextBox1.ClientID %&gt;&#8217;).value = date; }<br />
}<br />
else { $get(&#8216;&lt;%=TextBox1.ClientID %&gt;&#8217;).value = tmpDates; }<br />
}<br />
function calendarhidden(obj) {<br />
var tbxValue = $get(&#8216;&lt;%=TextBox1.ClientID %&gt;&#8217;).value;<br />
calendarBehavior = $find(&#8220;Calendar1&#8243;);<br />
if (tmpDates.toString() != tbxValue.toString()) {<br />
calendarBehavior.show();<br />
}<br />
}</p>
<p>&lt;/script&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/1009/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/1009/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/1009/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/1009/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/1009/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/1009/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/1009/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/1009/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=1009&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/10/15/select-multiple-dates-in-calendarextender/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>replace values in the QueryString key/value pairs</title>
		<link>http://bimawen.wordpress.com/2009/10/14/replace-values-in-the-querystring-keyvalue-pairs/</link>
		<comments>http://bimawen.wordpress.com/2009/10/14/replace-values-in-the-querystring-keyvalue-pairs/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 21:09:18 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Simple Sample]]></category>
		<category><![CDATA[asp.net basic]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=1002</guid>
		<description><![CDATA[The URL with a  QueryString is something like &#8220;apage.aspx?month=10&#38;year=2006&#38;&#8230;&#8221;, anything in Request.QueryString cannot be changed because it is readonly, but the values of &#8220;month&#8221; and &#8220;year&#8221; can be changed as followed: NameValueCollection nvc = HttpUtility.ParseQueryString(Request.QueryString.ToString()); nvc.Set(&#8220;month&#8221;, &#8220;12&#8243;); nvc.Set(&#8220;year&#8221;, &#8220;2009&#8243;); string newUrl = this.Request.ServerVariables["URL"].ToString() + &#8220;?&#8221; + nvc.ToString() ;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=1002&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The URL with a  QueryString is something like &#8220;apage.aspx?month=10&amp;year=2006&amp;&#8230;&#8221;, anything in Request.QueryString cannot be changed because it is readonly, but the values of &#8220;month&#8221; and &#8220;year&#8221; can be changed as followed:</p>
<p style="padding-left:30px;">NameValueCollection nvc = HttpUtility.ParseQueryString(Request.QueryString.ToString());</p>
<p style="padding-left:30px;">nvc.Set(&#8220;month&#8221;, &#8220;12&#8243;);</p>
<p style="padding-left:30px;">nvc.Set(&#8220;year&#8221;, &#8220;2009&#8243;);</p>
<p style="padding-left:30px;">string newUrl = this.Request.ServerVariables["URL"].ToString() + &#8220;?&#8221; + nvc.ToString() ;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/1002/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/1002/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/1002/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/1002/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/1002/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/1002/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/1002/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/1002/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=1002&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/10/14/replace-values-in-the-querystring-keyvalue-pairs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>populate TreeView with DataTable</title>
		<link>http://bimawen.wordpress.com/2009/10/05/populate-treeview-with-datatable/</link>
		<comments>http://bimawen.wordpress.com/2009/10/05/populate-treeview-with-datatable/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 19:30:55 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[ASP.NET2.0]]></category>
		<category><![CDATA[asp.net basic]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=988</guid>
		<description><![CDATA[TreeView can be bound with XmlDataSource and SiteMapDataSource controls (vs2008exp). But the data come up from the database, a strongly typed DataSet. So, manually populate a TreeView from a DataTable object, instead of auto binding: int currYear = 0; TreeNode curRootNode = new TreeNode(); int i = 0; do { rw = dt.Rows[i]; if (rw.theYear [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=988&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>TreeView can be bound with XmlDataSource and SiteMapDataSource controls (vs2008exp). But the data come up from the database, a strongly typed DataSet. So, manually populate a TreeView from a DataTable object, instead of auto binding:</p>
<p style="padding-left:30px;"><code>int currYear = 0;<br />
TreeNode curRootNode = new TreeNode();<br />
int i = 0;</code></p>
<p style="padding-left:30px;">do<br />
{<br />
rw = dt.Rows[i];<br />
if (rw.theYear != currYear)<br />
{<br />
currYear = rw.theYear;<br />
TreeNode root = new TreeNode(currYear);<br />
curRootNode = root;<br />
this.TreeView1.Nodes.Add(root);<br />
TreeNode child = new       TreeNode(Enum.GetName(typeof(ShortMonthName),rw.theMonth) + &#8220;. [" +       rw.itemNumber + "]&#8220;);<br />
curRootNode.ChildNodes.Add(child);<br />
}<br />
else<br />
{<br />
TreeNode child = new TreeNode(Enum.GetName(typeof(ShortMonthName), rw.theMonth) + &#8220;. [" + rw.itemNumber + "]&#8220;);<br />
curRootNode.ChildNodes.Add(child);<br />
}<br />
i++;<br />
} while (i &lt; dt.Rows.Count);</p>
<p style="padding-left:30px;">Here is the result:</p>
<p style="padding-left:30px;"><img class="aligncenter size-full wp-image-990" title="archiveTreeView" src="http://bimawen.files.wordpress.com/2009/10/archivetreeview1.png?w=278&#038;h=131" alt="archiveTreeView" width="278" height="131" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/988/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=988&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/10/05/populate-treeview-with-datatable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>

		<media:content url="http://bimawen.files.wordpress.com/2009/10/archivetreeview1.png" medium="image">
			<media:title type="html">archiveTreeView</media:title>
		</media:content>
	</item>
		<item>
		<title>create a TableAdapter method with parameters when using OLEDB</title>
		<link>http://bimawen.wordpress.com/2009/10/02/create-tableadapter-method-with-parameters-on-oledb/</link>
		<comments>http://bimawen.wordpress.com/2009/10/02/create-tableadapter-method-with-parameters-on-oledb/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 15:58:12 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[ASP.NET2.0]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[asp.net basic]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=982</guid>
		<description><![CDATA[If use the following query script for creating a TableAdapter method, like &#8220;GetDataById&#8221;, when using OLEDB: &#8220;SELECT * FROM aTable WHERE theID=@id&#8221; an error will happen: &#8220;error in where clause near &#8216;@&#8217; unable to parse query text&#8221; The solution is to use &#8220;?&#8221;, instead of &#8220;@variablename&#8221;, so teh following will succeed: &#8220;SELECT * FROM aTable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=982&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If use the following query script for creating a TableAdapter method, like &#8220;GetDataById&#8221;, when using OLEDB:</p>
<p>&#8220;SELECT * FROM aTable WHERE theID=@id&#8221;</p>
<p>an error will happen:</p>
<p>&#8220;error in where clause near &#8216;@&#8217; unable to parse query text&#8221;</p>
<p>The solution is to use &#8220;?&#8221;, instead of &#8220;@variablename&#8221;, so teh following will succeed:</p>
<p>&#8220;SELECT * FROM aTable WHERE theID=?&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/982/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=982&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/10/02/create-tableadapter-method-with-parameters-on-oledb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>browser-compatible font families</title>
		<link>http://bimawen.wordpress.com/2009/09/13/browser-compatible-font-families/</link>
		<comments>http://bimawen.wordpress.com/2009/09/13/browser-compatible-font-families/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 22:22:48 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[web programming]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=970</guid>
		<description><![CDATA[There are five generic font families, each including some fonts: serif:   have finishing strokes, flared or tapering ends, or have actual serifed endings (including slab serifs);  are typically proportionately-spaced;  often display a greater variation between thick and thin strokes than fonts from the &#8216;sans-serif&#8217; generic font family. Examples of fonts that fit this description include: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=970&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are five generic font families, each including some fonts: <strong> </strong></p>
<p><strong>serif</strong>:   have finishing strokes, flared or tapering ends, or have actual serifed endings (including slab serifs);  are typically proportionately-spaced;  often display a greater variation between thick and thin strokes than fonts from the &#8216;sans-serif&#8217; generic font family. Examples of fonts that fit this description include:</p>
<ul>
<li><span style="color:#993366;">Garamond</span></li>
<li><span style="color:#993366;">Georgia</span></li>
<li><span style="color:#993366;">New York</span></li>
<li><span style="color:#993366;">Times</span></li>
<li><span style="color:#993366;">Times New Roman</span></li>
</ul>
<table style="margin-left:20px;" border="1">
<tbody>
<tr>
<td rowspan="2">font</td>
<td colspan="3">installed(%)</td>
</tr>
<tr>
<td>win</td>
<td>mac</td>
<td>unix</td>
</tr>
<tr>
<td>Georgia</td>
<td>97.76</td>
<td>94.20</td>
<td>57.70</td>
</tr>
<tr>
<td>Times New Roman</td>
<td>97.51</td>
<td>91.71</td>
<td>60.98</td>
</tr>
<tr>
<td>Lucida Bright</td>
<td>30.01</td>
<td>59.77</td>
<td>73.97</td>
</tr>
</tbody>
</table>
<p><strong>sans serif</strong>:  have stroke endings that are plain &#8212; without any flaring, cross stroke, or other ornamentation;  are typically proportionately-spaced;   often have little variation between thick and thin strokes, compared to fonts from the &#8216;serif&#8217; family. Examples of fonts that fit this description include:</p>
<ul>
<li><span style="color:#993366;">Arial</span></li>
<li><span style="color:#993366;">Geneva</span></li>
<li><span style="color:#993366;">Helvetica</span></li>
<li><span style="color:#993366;">Lucida Sans</span></li>
<li><span style="color:#993366;">Trebuchet</span></li>
<li><span style="color:#993366;">Verdana</span></li>
</ul>
<table style="margin-left:20px;" border="1">
<tbody>
<tr>
<td rowspan="2">font</td>
<td colspan="3">installed(%)</td>
</tr>
<tr>
<td>win</td>
<td>mac</td>
<td>unix</td>
</tr>
<tr>
<td>Verdana</td>
<td>99.13</td>
<td>95.58</td>
<td>59.67</td>
</tr>
<tr>
<td>Tahoma</td>
<td>98.98</td>
<td>74.86</td>
<td>&#8212;-</td>
</tr>
<tr>
<td>Arial</td>
<td>98.73</td>
<td>96.41</td>
<td>65.90</td>
</tr>
<tr>
<td>Lucida Sans</td>
<td>41.17</td>
<td>59.77</td>
<td>73.97</td>
</tr>
</tbody>
</table>
<p><strong>monospace:</strong> have the same fixed width so it is similar to a manual typewriter<strong>. </strong>Examples of fonts that fit this description include:</p>
<ul>
<li><span style="color:#993366;">Courier New</span></li>
<li><span style="color:#993366;">Courier</span></li>
<li><span style="color:#993366;">monospac</span></li>
</ul>
<table style="margin-left:20px;" border="1">
<tbody>
<tr>
<td rowspan="2">font</td>
<td colspan="3">installed(%)</td>
</tr>
<tr>
<td>win</td>
<td>mac</td>
<td>unix</td>
</tr>
<tr>
<td>Courier New</td>
<td>98.73</td>
<td>90.88</td>
<td>64.59</td>
</tr>
<tr>
<td>Monaco</td>
<td>2.77</td>
<td>98.34</td>
<td>4.11</td>
</tr>
</tbody>
</table>
<p><strong>cursive</strong> and <strong>fantasy</strong> are not suggested to be used in the body text.</p>
<p>Some common rules:</p>
<ol>
<li>Sans serif for online, serif for print.</li>
<li>Monospace for typewriter and code.</li>
<li>Cursive and fantasy for accents.</li>
</ol>
<p>The following combinations are fairly safe when it comes to universal application across operating systems and browser platforms:</p>
<ul>
<li>Arial, Helvetica, sans-serif</li>
<li>Verdana, Arial, Helvetica, sans-serif</li>
<li>Georgia, Times New Roman, Times, serif</li>
<li>Times New Roman, Times, serif</li>
<li>Courier New, Courier, monospace</li>
</ul>
<p>[references]</p>
<p>http://www.codestyle.org</p>
<p>http://webdesign.about.com/od/fonts/a/aa080204.htm</p>
<p>http://www.w3.org/TR/CSS2/fonts.html#generic-font-families</p>
<p>&#8220;Prof ASP.NET 2.0 Design _ CSS, Themes, and Master Pages&#8221;, Wrox, 2007</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/970/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=970&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/09/13/browser-compatible-font-families/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>add combobox items with different text and value</title>
		<link>http://bimawen.wordpress.com/2009/09/03/add-combobox-items-with-different-text-and-value/</link>
		<comments>http://bimawen.wordpress.com/2009/09/03/add-combobox-items-with-different-text-and-value/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 22:03:21 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[codes]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=961</guid>
		<description><![CDATA[We can do it with DataBinding a combobox with DataSet or DataTable object. And we can also do it with customer objects. There are two ways to do this. Here is the customer object: public class cbxItem { private string _Text; private long _Value; public string Text{get{return _Text;}} public long Value{get{return _Value;}} public cbxItem(string theText, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=961&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We can do it with DataBinding a combobox with DataSet or DataTable object. And we can also do it with customer objects. There are two ways to do this.</p>
<p><strong>Here is the customer object:</strong></p>
<p style="padding-left:30px;">public class cbxItem<br />
{<br />
private string _Text;<br />
private long _Value;<br />
public string Text{get{return _Text;}}<br />
public long Value{get{return _Value;}}<br />
public cbxItem(string theText, long theValue)<br />
{<br />
_Text = theText;<br />
_Value = theValue;<br />
}<br />
}</p>
<p><strong>Way 1: using DataBinding with customer objects as DataSet</strong></p>
<p style="padding-left:30px;">&#8230;&#8230;<br />
ArrayList cbxObjects= new ArrayList();<br />
while(theDataReader.Read())<br />
{<br />
cbxObjects.Add (new cbxItem           (theDataReader.GetString(1),theDataReader.GetInt32 (0)));<br />
}<br />
this.ComboBox1.DataSource = Authors;<br />
this.ComboBox1.DisplayMember =&#8221;Text&#8221;;<br />
this.ComboBox1.ValueMember = &#8220;Value&#8221;;<br />
&#8230;&#8230;</p>
<p><strong>Way 2: directly using ComboBox.items.Add(obj) with customer objects:</strong></p>
<p style="padding-left:30px;">&#8230;&#8230;<br />
while(theDataReader.Read())<br />
{<br />
ComboBox1.Items.Add (new cbxItem    (theDataReader.GetString(1),theDataReader.GetInt32 (0)));<br />
}<br />
&#8230;&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/961/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=961&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/09/03/add-combobox-items-with-different-text-and-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>combine multiple rows in one</title>
		<link>http://bimawen.wordpress.com/2009/09/03/combine-multiple-rows-in-one/</link>
		<comments>http://bimawen.wordpress.com/2009/09/03/combine-multiple-rows-in-one/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 20:05:26 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=952</guid>
		<description><![CDATA[I have a table as: itemID tagID 100                111 200                222 200                223 300                333 300                334 300                335 I want to have a select statement to group records by itemID and one itemID will have only one row, multiple tagIDs will be combined in one field. Step1: create a scalar-valued function (UDF) ALTER FUNCTION [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=952&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a table as:</p>
<p><span style="text-decoration:underline;width:100px;">itemID</span> <span style="text-decoration:underline;">tagID</span><br />
100                111<br />
200                222<br />
200                223<br />
300                333<br />
300                334<br />
300                335</p>
<p>I want to have a select statement to group records by itemID and one itemID will have only one row, multiple tagIDs will be combined in one field.</p>
<p><strong>Step1: create a scalar-valued function (UDF)</strong></p>
<p>ALTER FUNCTION sUDF_itemTagIds(@aItemId int)<br />
RETURNS varchar(MAX)<br />
AS<br />
BEGIN<br />
DECLARE @tagids varchar(max)<br />
SELECT @tagids = COALESCE(@tagids + &#8216;,&#8217;,&#8221;) + convert(varchar(20),tagID)<br />
FROM myTable<br />
WHERE itemID = @aItemId<br />
RETURN @tagids<br />
END<br />
GO</p>
<p><strong>Step2: call the UDF from the SQL script:</strong></p>
<p>SELECT itemID,dbo.sUDF_itemTagIds(itemID) as tagIDs<br />
FROM myTable<br />
GROUP BY itemID</p>
<p><strong>Here is the result:</strong></p>
<p><span style="text-decoration:underline;">itemID</span> <span style="text-decoration:underline;">tagIDs</span><br />
100                111<br />
200                222,223<br />
300                333,334,335</p>
<p><span style="color:#008080;"><em><strong>Intro to User Defined Functions</strong></em></span></p>
<p><span style="color:#008080;"><em>The ability to create a user-defined function (UDF) is a new feature added to SQL Server 2000.</em></span></p>
<p><span style="color:#008080;"><em>A user-defined function is a database object that encapsulates one or more Transact-SQL statements for reuse. This definition is similar to the one for stored procedures, but there are many important differences between user-defined functions and stored procedures—the most pronounced being what types of data they can return.</em></span></p>
<h4><span style="color:#008080;"><em>Scalar Functions</em></span></h4>
<p><span style="color:#008080;"><em>A scalar function returns a single value of the data type referenced in the RETURNS clause of the CREATE FUNCTION statement. The returned data can be of any type except text, ntext, image, cursor, or timestamp.</em></span></p>
<h4><span style="color:#008080;"><em>Inline Table-Valued Functions</em></span></h4>
<p><span style="color:#008080;"><em>An inline table-valued function returns a variable of data type table whose value is derived from a single SELECT statement.</em></span></p>
<h4><span style="color:#008080;"><em>Multi-Statement Table-Valued Functions</em></span></h4>
<p><span style="color:#008080;"><em>The multi-statement table-valued function is slightly more complicated than the other two types of functions because it uses multiple statements to build the table that is returned to the calling statement. Unlike the inline table-valued function, a table variable must be explicitly declared and defined.</em></span></p>
<div><span style="color:#008080;"><em>COALESCE</em></span></div>
<p><!--Content type: PSDK_9. Transform: psdk2mtps.xslt.--><span style="color:#008080;"><em><a name="_coalesce"></a></em></span></p>
<p><span style="color:#008080;"><em>Returns the first nonnull expression among its arguments.</em></span></p>
<h5><span style="color:#008080;"><em>Syntax</em></span></h5>
<p><span style="color:#008080;"><em><code>COALESCE <strong>( </strong><em>expression</em> [ <strong>,</strong><em>...n </em>] <strong>) </strong></code></em></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/952/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/952/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/952/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/952/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/952/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/952/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/952/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/952/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=952&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/09/03/combine-multiple-rows-in-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>father day gift from my little daughter</title>
		<link>http://bimawen.wordpress.com/2009/06/25/father-day-gift-from-my-daughter/</link>
		<comments>http://bimawen.wordpress.com/2009/06/25/father-day-gift-from-my-daughter/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 18:23:23 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=945</guid>
		<description><![CDATA[The mountain is my father I say help me He said what problem do you need help with, I say heal me, He stays with me until I feel better, I say buy this book, He said Okey, I say I&#8217;m tired on the mountain, He said we&#8217;ll rest for a while, &#8230; I am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=945&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The mountain is my father</p>
<p>I say help me</p>
<p>He said what</p>
<p>problem do you need help with,</p>
<p>I say heal me,</p>
<p>He stays with me until I feel better,</p>
<p>I say buy this book,</p>
<p>He said Okey,</p>
<p>I say I&#8217;m tired on the mountain,</p>
<p>He said we&#8217;ll rest</p>
<p>for a while,</p>
<p>&#8230;</p>
<p>I am feeling warm from the bottom of my heart, and also I am feeling higher pressure because I know being a mountain is not that easy. Hehe, sweet heart, let me try that,&#8230;&#8230;</p>
<p>This is best gift I had! I am proud of that she can write a poem now, when she is almost nine year old!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/945/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=945&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/06/25/father-day-gift-from-my-daughter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
		<item>
		<title>use unique index when do insert through SqlDataSource</title>
		<link>http://bimawen.wordpress.com/2009/06/19/use-unique-index-when-do-insert-through-sqldatasource/</link>
		<comments>http://bimawen.wordpress.com/2009/06/19/use-unique-index-when-do-insert-through-sqldatasource/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 16:31:11 +0000</pubDate>
		<dc:creator>bimawen</dc:creator>
				<category><![CDATA[ASP.NET2.0]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://bimawen.wordpress.com/?p=943</guid>
		<description><![CDATA[email is not a primary but can not be duplicated, otherwise, the same query would get different result. I have a DetailsView bound to a SqlDataSource and then call a sproc to insert a new record. The simple solution to keep from creating two records with one same email is to set the email field [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=943&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>email is not a primary but can not be duplicated, otherwise, the same query would get different result. I have a DetailsView bound to a SqlDataSource and then call a sproc to insert a new record. The simple solution to keep from creating two records with one same email is to set the email field as a unique index:</p>
<p>Create Unique Index indx_tablename_columnName On tableName (columnName)</p>
<p>When somebody tried to create a dup record, SqlDataSource1_ItemInserted would get an error message. Then, we can capture it and do something else&#8230;</p>
<p>The better way is to modify the sproc as:</p>
<p>Create Proc [Sp_Insert]<br />
@email varchar(128),<br />
&#8230;&#8230;<br />
@returnValue  int output<br />
As<br />
If Exists(Select * From theTable Where email=@email)<br />
Begin<br />
Set @returnValue = 0<br />
End<br />
Else<br />
Begin<br />
Insert Into theTable (email,&#8230;) Values(@email,&#8230;)<br />
Set @returnValue = 1<br />
End</p>
<p>So get a flag in SqlDataSource1_ItemInserted, instead of an error message, no error happened in SQlServer.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bimawen.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bimawen.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bimawen.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bimawen.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bimawen.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bimawen.wordpress.com/943/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bimawen.wordpress.com/943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bimawen.wordpress.com/943/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bimawen.wordpress.com&amp;blog=6700474&amp;post=943&amp;subd=bimawen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bimawen.wordpress.com/2009/06/19/use-unique-index-when-do-insert-through-sqldatasource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ddc5473c32b8672e71c72278e2d37171?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bimawen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
