<?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/"
	>

<channel>
	<title>Cyberpunk &#187; SQL Server</title>
	<atom:link href="http://punk.tw/tag/sql-server/feed" rel="self" type="application/rss+xml" />
	<link>http://punk.tw</link>
	<description>網際叛客：學習心得、Web 2.0與網路觀察、Google應用與技術、Ruby on Rails, Google App Engine</description>
	<lastBuildDate>Tue, 07 Feb 2012 08:42:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SQL Server：從字元字串轉換到 datetime 時，轉換失敗</title>
		<link>http://punk.tw/2007/10/08/sql-server%ef%bc%9a%e5%be%9e%e5%ad%97%e5%85%83%e5%ad%97%e4%b8%b2%e8%bd%89%e6%8f%9b%e5%88%b0-datetime-%e6%99%82%ef%bc%8c%e8%bd%89%e6%8f%9b%e5%a4%b1%e6%95%97</link>
		<comments>http://punk.tw/2007/10/08/sql-server%ef%bc%9a%e5%be%9e%e5%ad%97%e5%85%83%e5%ad%97%e4%b8%b2%e8%bd%89%e6%8f%9b%e5%88%b0-datetime-%e6%99%82%ef%bc%8c%e8%bd%89%e6%8f%9b%e5%a4%b1%e6%95%97#comments</comments>
		<pubDate>Sun, 07 Oct 2007 18:27:41 +0000</pubDate>
		<dc:creator>deduce</dc:creator>
				<category><![CDATA[程式設計]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://punk.tw/2007/10/08/343.html</guid>
		<description><![CDATA[剛剛用C#在對資料庫塞資料，SQL語法中有牽涉到日期的處理，因此我是動態來兜SQL語法的，例如： string strSQL = string.Format("SELECT id, title, content FROM posts WHERE ( date < '{0}' )", myCalendar.SelectedDate) // myCalendar是一個萬年曆的物件 沒想到在本機上測試都沒問題，但丟到遠端資料庫時卻會出錯（從字元字串轉換到 datetime 時，轉換失敗），我猜是因為日期的格式出了問題，有可能是語系不同所造成的，總之我將日期的格式轉成下列格式就沒問題啦:p myCalendar.SelectedDate.toString("yyyy/MM/dd HH:mm:ss");]]></description>
			<content:encoded><![CDATA[<p>剛剛用C#在對資料庫塞資料，SQL語法中有牽涉到日期的處理，因此我是動態來兜SQL語法的，例如：</p>
<p>
<pre class="prettyprint">string strSQL =
    string.Format("SELECT id, title, content FROM posts WHERE ( date < '{0}' )",
          myCalendar.SelectedDate)

// myCalendar是一個萬年曆的物件
</pre>
<p>沒想到在本機上測試都沒問題，但丟到遠端資料庫時卻會出錯（從字元字串轉換到 datetime 時，轉換失敗），我猜是因為日期的格式出了問題，有可能是語系不同所造成的，總之我將日期的格式轉成下列格式就沒問題啦:p </p>
<p>
<pre class="prettyprint">myCalendar.SelectedDate.toString("yyyy/MM/dd HH:mm:ss"); </pre></p>
]]></content:encoded>
			<wfw:commentRss>http://punk.tw/2007/10/08/sql-server%ef%bc%9a%e5%be%9e%e5%ad%97%e5%85%83%e5%ad%97%e4%b8%b2%e8%bd%89%e6%8f%9b%e5%88%b0-datetime-%e6%99%82%ef%bc%8c%e8%bd%89%e6%8f%9b%e5%a4%b1%e6%95%97/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

