<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>leodo@blog-筆記備忘</title>
<link>http://blog.roodo.com/soboring/archives/cat_97241.html</link>
<description>


_uacct = &quot;UA-115290-2&quot;;
urchinTracker();



</description>
<language>zh-tw</language>
<generator>Roodo Blog System</generator>
<copyright>All Rights Reserved</copyright>
<atom:link href="http://blog.roodo.com/soboring/archives/cat_97241.xml" rel="self" type="application/rss+xml" />
<item>
	<title>收驚文</title>
	<description><![CDATA[
			天無忌　地無忌　普蓭到此並無禁忌
道法本無多　南辰貫北河　算來無盡數　合斬世間魔
鬼魅若不順我　道心請盡　雷霹靂粉粹
普蓭咒　普蓭經　手執素珠口唸經　
上天下方多清　上有琉璃或夜界　若有蓮花滿地開
解英體　晟英身　弟子（信女）ｘｘｘ
災秧化為塵　普蓭咒　普蓭經　普蓭菩薩降來臨
起忌天無煞　地無煞　年無煞　月無煞　日無煞　時無煞　
起忌凶星　起忌定(木桑)　起忌土木神煞 起忌一百連八煞
急急如律令


（三清）奉勅令普蓭到此罡　

		]]>
	</description>
	<content:encoded><![CDATA[
			天無忌　地無忌　普蓭到此並無禁忌<br />
道法本無多　南辰貫北河　算來無盡數　合斬世間魔<br />
鬼魅若不順我　道心請盡　雷霹靂粉粹<br />
普蓭咒　普蓭經　手執素珠口唸經　<br />
上天下方多清　上有琉璃或夜界　若有蓮花滿地開<br />
解英體　晟英身　弟子（信女）ｘｘｘ<br />
災秧化為塵　普蓭咒　普蓭經　普蓭菩薩降來臨<br />
起忌天無煞　地無煞　年無煞　月無煞　日無煞　時無煞　<br />
起忌凶星　起忌定(木桑)　起忌土木神煞 起忌一百連八煞<br />
急急如律令<br />
<br />
<br />
（三清）奉勅令普蓭到此罡　<br />

		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/8195521.html</link>
	<guid>http://blog.roodo.com/soboring/archives/8195521.html</guid>
	<category>筆記備忘</category>
	<pubDate>Thu, 29 Jan 2009 20:52:31 +0800</pubDate>
</item>
<item>
	<title>[Tip]Convert Mysql to Postgresql</title>
	<description><![CDATA[
			%MySQL%/bin
mysqldump $DATABASE_NAME -v -nt --compatible=ansi,postgresql --complete-insert=TRUE --extended-insert=FALSE --compact --default-character-set=UTF8 -u $DATABASE_USER -p -r $OUTPUT_FILE

%Postgresql%/bin
psql -d $DATABASE_NAME -f $OUTPUT_FILE -U user_name -W


		]]>
	</description>
	<content:encoded><![CDATA[
			%MySQL%/bin<br />
mysqldump $DATABASE_NAME -v -nt --compatible=ansi,postgresql --complete-insert=TRUE --extended-insert=FALSE --compact --default-character-set=UTF8 -u $DATABASE_USER -p -r $OUTPUT_FILE<br />
<br />
%Postgresql%/bin<br />
psql -d $DATABASE_NAME -f $OUTPUT_FILE -U user_name -W<br />
<br />

		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/7718501.html</link>
	<guid>http://blog.roodo.com/soboring/archives/7718501.html</guid>
	<category>筆記備忘</category>
	<pubDate>Tue, 25 Nov 2008 15:04:14 +0800</pubDate>
</item>
<item>
	<title>Convert shapefile to PostgreSQL in Windows XP using shp2pgsql</title>
	<description><![CDATA[
			:::可以解決在Windows環境下中文編碼的問題::::

1. 將*.shp檔轉為文字檔
　shp2pgsql  db.shp public.table  -> db.sql
2. 用記事本另存 db.sql 為 UTF-8 Encoding
3. 刪除db.sql中異常字元(e.g. \ )
4. psql -d database_name -f db.sql -U user_name -W


		]]>
	</description>
	<content:encoded><![CDATA[
			:::可以解決在Windows環境下中文編碼的問題::::<br />
<br />
1. 將*.shp檔轉為文字檔<br />
　shp2pgsql  db.shp public.table  -> db.sql<br />
2. 用記事本另存 db.sql 為 UTF-8 Encoding<br />
3. 刪除db.sql中異常字元(e.g. \ )<br />
4. psql -d database_name -f db.sql -U user_name -W<br />
<br />

		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/7566545.html</link>
	<guid>http://blog.roodo.com/soboring/archives/7566545.html</guid>
	<category>筆記備忘</category>
	<pubDate>Thu, 13 Nov 2008 20:28:28 +0800</pubDate>
</item>
<item>
	<title>[筆記]專利侵害鑑定流程</title>
	<description><![CDATA[
			

在專利侵權鑑定報告主要是依據專利的專利侵權鑑定理論來進行，而專利侵權理論不外乎是考慮下列三項原則。
1. 字義侵權( literal infringement)
2. 均等論( doctrine of equivalents)
3. 禁反言( file wrapper estoppel)


		]]>
	</description>
	<content:encoded><![CDATA[
			<div class="pict"><a href="http://blog.roodo.com/soboring/1765d418.gif" target="_blank"><img src="http://blog.roodo.com/soboring/1765d418_s.gif" width="160" height="127" border="0" alt="專利侵害鑑定流程圖" hspace="5" class="pict" align="left"></a></div><br />
<br />
在專利侵權鑑定報告主要是依據專利的專利侵權鑑定理論來進行，而專利侵權理論不外乎是考慮下列三項原則。<br />
1. 字義侵權( literal infringement)<br />
2. 均等論( doctrine of equivalents)<br />
3. 禁反言( file wrapper estoppel)<br />
<br />

		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/5827569.html</link>
	<guid>http://blog.roodo.com/soboring/archives/5827569.html</guid>
	<category>筆記備忘</category>
	<pubDate>Wed, 02 Apr 2008 23:49:03 +0800</pubDate>
</item>
<item>
	<title>[JAVA] JDBC bug CachedRowSet with the column &quot;Text, NText&quot; in Sql Server 2000</title>
	<description><![CDATA[
			使用sun.jdbc.rowset.CachedRowSet時會發生的怪問題，當MS SQL server 2000的資料欄位型態是 text or ntext的時候，如果資料是空字串，會Catch到SQLException： underlying input stream returned zero bytes。Solution：改用varchar就沒事了....  囧....
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>使用<strong>sun.jdbc.rowset.CachedRowSet</strong>時會發生的怪問題，當MS SQL server 2000的資料欄位型態是<strong> text or ntext</strong>的時候，如果資料是<strong>空字串</strong>，會Catch到SQLException： underlying input stream returned zero bytes。<br /><br />Solution：改用varchar就沒事了....  囧....</p>
		<a class="acontinues" href="http://blog.roodo.com/soboring/archives/2639677.html">(繼續閱讀...)</a>
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/2639677.html</link>
	<guid>http://blog.roodo.com/soboring/archives/2639677.html</guid>
	<category>筆記備忘</category>
	<pubDate>Fri, 12 Jan 2007 09:49:47 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]連結Crystal Report</title>
	<description><![CDATA[
			Import  CrystalDecisions.CrystalReports.Engine  ( for ReportDocument物件)            CrystalDecisions.Shared   ( for TableLogOnInfo 物件 ) code behindusing CrystalDecisions.Web;using CrystalDecisions.CrystalReports.Engine;using CrystalDecisions.Shared;private void Page_Load(object sender, System.EventArgs e){    ReportDocument crReport = new ReportDocument();    Config.CrystalReportConnection(ref crReport,&quot;CrystalReport1.rpt&quot;);       //第二個參數是Crystal Report報表檔名    crvReport.ReportSource=crReport;    //crvReport is Crystal Report Viewer's ID}Config.cspublic static void CrystalReportConnection(ref CrystalDecisions.CrystalReports.Engine.ReportDocument crReport, string CrystalReportFileName){   crReport.Load(System.Web.HttpContext.Current.Server.MapPath(Config.getInstance().crystalReport_FileRoot) +&quot;/&quot;+ CrystalReportFileName);   //設定 *.rpt 檔案來源   //下述設定連結內容   TableLogOnInfo crLogOnInfo = new TableLogOnInfo();   foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crReport.Database.Tables)   {    crLogOnInfo = crTable.LogOnInfo;    crLogOnInfo.ConnectionInfo.ServerName=&quot;server ip&quot;;    crLogOnInfo.ConnectionInfo.UserID=&quot;id&quot;;    crLogOnInfo.ConnectionInfo.Password=&quot;pwd&quot;;    crLogOnInfo.ConnectionInfo.DatabaseName=&quot;DB_name&quot;;    crTable.ApplyLogOnInfo(crLogOnInfo);   }   //上述設定連結內容}
		]]>
	</description>
	<content:encoded><![CDATA[
			<p><br />Import  CrystalDecisions.CrystalReports.Engine  ( for ReportDocument物件)<br />            CrystalDecisions.Shared   ( for TableLogOnInfo 物件 ) <br /></p><p>code behind</p><p>using CrystalDecisions.Web;<br />using CrystalDecisions.CrystalReports.Engine;<br />using CrystalDecisions.Shared;<br />private void Page_Load(object sender, System.EventArgs e)<br />{<br />    ReportDocument crReport = new ReportDocument();<br />    Config.CrystalReportConnection(ref crReport,&quot;CrystalReport1.rpt&quot;);   <br />    //第二個參數是Crystal Report報表檔名<br /><br />    crvReport.ReportSource=crReport;    //crvReport is Crystal Report Viewer's ID<br />}<br /></p><p>Config.cs</p><p>public static void CrystalReportConnection(ref CrystalDecisions.CrystalReports.Engine.ReportDocument crReport, string CrystalReportFileName)<br />{<br />   crReport.Load(<strong>System.Web.HttpContext.Current.Server.MapPath</strong>(Config.getInstance().crystalReport_FileRoot) +&quot;/&quot;+ CrystalReportFileName);<br />   <strong>//設定 *.rpt 檔案來源<br /></strong><br />   //下述設定連結內容<br />   TableLogOnInfo crLogOnInfo = new TableLogOnInfo();<br />   foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crReport.Database.Tables)<br />   {<br />    crLogOnInfo = crTable.LogOnInfo;<br />    crLogOnInfo.ConnectionInfo.ServerName=&quot;server ip&quot;;<br />    crLogOnInfo.ConnectionInfo.UserID=&quot;id&quot;;<br />    crLogOnInfo.ConnectionInfo.Password=&quot;pwd&quot;;<br />    crLogOnInfo.ConnectionInfo.DatabaseName=&quot;DB_name&quot;;<br />    crTable.ApplyLogOnInfo(crLogOnInfo);<br />   }<br />   //上述設定連結內容<br />}<br /></p><p><br /></p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/882487.html</link>
	<guid>http://blog.roodo.com/soboring/archives/882487.html</guid>
	<category>筆記備忘</category>
	<pubDate>Mon, 19 Dec 2005 15:10:58 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]DataSet新增資料(DataRow)並透過xml格式儲存讀寫</title>
	<description><![CDATA[
			寫try   {    //建立儲存選取之mailing List DataSet    DataSet ds = new DataSet();    ds.Tables.Add(&quot;CHECKED&quot;);      //新增CHECKED資料表至DATASET ds之中    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;STU_ID&quot;);  //新增欄位STU_ID至DATASET ds之中    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;STU_NAME&quot;);    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;CMP_NAME&quot;);     ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;EMAIL&quot;);      for(int i = 0; i&lt;dgEmail.Items.Count; i++)    {     HtmlInputCheckBox app_no = (HtmlInputCheckBox)dgEmail.Items[i].FindControl(&quot;chkSTU_ID&quot;);     if(app_no.Checked)     {      System.Data.DataRow row = ds.Tables[&quot;CHECKED&quot;].NewRow();                row[&quot;STU_ID&quot;]=dgEmail.Items[i].Cells[6].Text;      //由dgEmail這個DataGrid新增學生編號       row[&quot;STU_NAME&quot;]=dgEmail.Items[i].Cells[0].Text;       row[&quot;CMP_NAME&quot;]=dgEmail.Items[i].Cells[1].Text;       row[&quot;EMAIL&quot;]=dgEmail.Items[i].Cells[4].Text;            ds.Tables[&quot;CHECKED&quot;].Rows.Add(row);     }    }    //將建立之mailing List DataSet的資料寫入 mailList.xml 檔案    ds.WriteXml(Server.MapPath(Config.Document.Training_Education)+ &quot;/mailList.xml&quot;,XmlWriteMode.WriteSchema);    ds.Dispose();}   catch(Exception ex)   {    Response.Write(ex.Message);      }讀DataSet ds = new DataSet();    ds.ReadXml(Server.MapPath(Config.Document.Training_Education)+&quot;/mailList.xml&quot;); 
		]]>
	</description>
	<content:encoded><![CDATA[
			<p><br />寫<br /></p><hr />try<br />   {<br />    <strong>//建立儲存選取之mailing List DataSet</strong><br />    DataSet ds = new DataSet();<br />    ds.Tables.Add(&quot;CHECKED&quot;);      //新增CHECKED資料表至DATASET ds之中<br />    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;STU_ID&quot;);  //新增欄位STU_ID至DATASET ds之中<br />    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;STU_NAME&quot;);<br />    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;CMP_NAME&quot;); <br />    ds.Tables[&quot;CHECKED&quot;].Columns.Add(&quot;EMAIL&quot;);  <br />    for(int i = 0; i&lt;dgEmail.Items.Count; i++)<br />    {<br />     HtmlInputCheckBox app_no = (HtmlInputCheckBox)dgEmail.Items[i].FindControl(&quot;chkSTU_ID&quot;);<p /><p>     if(app_no.Checked)<br />     {<br />      <strong>System.Data.DataRow row = ds.Tables[&quot;CHECKED&quot;].NewRow();</strong><br />         <br />       row[&quot;STU_ID&quot;]=dgEmail.Items[i].Cells[6].Text;      //由dgEmail這個DataGrid新增學生編號<br />       row[&quot;STU_NAME&quot;]=dgEmail.Items[i].Cells[0].Text;<br />       row[&quot;CMP_NAME&quot;]=dgEmail.Items[i].Cells[1].Text;<br />       row[&quot;EMAIL&quot;]=dgEmail.Items[i].Cells[4].Text;<br />      <br />     <strong> ds.Tables[&quot;CHECKED&quot;].Rows.Add(row);<br /></strong>     }<br />    }<br />    //將建立之mailing List DataSet的資料寫入 mailList.xml 檔案<br />    <strong>ds.WriteXml(Server.MapPath(Config.Document.Training_Education)+ &quot;/mailList.xml&quot;,XmlWriteMode.WriteSchema);<br /></strong>    ds.Dispose();<br />}<br />   catch(Exception ex)<br />   {<br />    Response.Write(ex.Message);   <br />   }</p><hr /><br />讀<hr /><p />DataSet ds = new DataSet();<br />    ds.ReadXml(Server.MapPath(Config.Document.Training_Education)+&quot;/mailList.xml&quot;); 
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/826059.html</link>
	<guid>http://blog.roodo.com/soboring/archives/826059.html</guid>
	<category>筆記備忘</category>
	<pubDate>Mon, 05 Dec 2005 13:56:59 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]CodeBehind web control button結合前瑞javascript的方法</title>
	<description><![CDATA[
			Codebehind的情形之下，利用web form控制項(HTML控制項以伺服器端執行不能run)在中的Attribute屬性，可以和前端的javascript做結合，當我們新增一個Attribute屬性，就代表著最後產生HTML code之後的一個屬性或方法。常常寫程式會遇到double check的情形以增加程序上的正確性，可利用如下程式碼。private void Page_Load(object sender, System.EventArgs e){    btnSubmit.Attributes.Add(&quot;onclick&quot;,&quot;javascript:return confirm('sure?');&quot;);}
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>Codebehind的情形之下，利用<strong>web form控制項</strong>(HTML控制項以伺服器端執行不能run)在中的Attribute屬性，可以和前端的javascript做結合，當我們新增一個Attribute屬性，就代表著最後產生HTML code之後的一個屬性或方法。<br />常常寫程式會遇到double check的情形以增加程序上的正確性，可利用如下程式碼。<br /><br />private void Page_Load(object sender, System.EventArgs e)<br />{<br />    btnSubmit.Attributes.Add(&quot;onclick&quot;,&quot;javascript:return confirm('sure?');&quot;);<br />}<br /></p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/812828.html</link>
	<guid>http://blog.roodo.com/soboring/archives/812828.html</guid>
	<category>筆記備忘</category>
	<pubDate>Fri, 02 Dec 2005 18:17:25 +0800</pubDate>
</item>
<item>
	<title>DataGrid中製作Delete(刪除)按紐</title>
	<description><![CDATA[
			HTML在DataGrid的asp:ButtonColumn屬性增加下面這一段&lt;asp:ButtonColumn HeaderText=&quot;功能&quot; Text=&quot;&amp;lt;div id=&amp;quot;de&amp;quot; onclick=&amp;quot;JavaScript:return confirm('確定要刪除？')&amp;quot;&amp;gt;刪除&amp;lt;/div&amp;gt;&quot; CommandName=&quot;Delete&quot;&gt;C#    CodeBehind  private void dgHR_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)  {   string key = dgHR.DataKeys[e.Item.ItemIndex].ToString();   string sql = &quot;Delete from ALLIANCE_HR where EMP_NO = '&quot; + key + &quot;'&quot;;   SqlConnection conn = new SqlConnection(Config.CONN_STRING);   conn.Open();   SqlCommand cmd = new SqlCommand(sql,conn);   cmd.ExecuteNonQuery();   cmd.Dispose();   conn.Close();  }
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>HTML<br /></p><hr />在DataGrid的asp:ButtonColumn屬性增加下面這一段<br />&lt;asp:ButtonColumn HeaderText=&quot;功能&quot; Text=&quot;&amp;lt;div id=&amp;quot;de&amp;quot; onclick=&amp;quot;JavaScript:return confirm('確定要刪除？')&amp;quot;&amp;gt;刪除&amp;lt;/div&amp;gt;&quot; CommandName=&quot;Delete&quot;&gt;<br /><hr /><br /><br />C#    CodeBehind <hr /> private void dgHR_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)<br />  {<br />   string key = dgHR.DataKeys[e.Item.ItemIndex].ToString();<br />   string sql = &quot;Delete from ALLIANCE_HR where EMP_NO = '&quot; + key + &quot;'&quot;;<br />   SqlConnection conn = new SqlConnection(Config.CONN_STRING);<br />   conn.Open();<br />   SqlCommand cmd = new SqlCommand(sql,conn);<br />   cmd.ExecuteNonQuery();<br />   cmd.Dispose();<br />   conn.Close();<br />  }<br /><br /><br /><p />
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/791965.html</link>
	<guid>http://blog.roodo.com/soboring/archives/791965.html</guid>
	<category>筆記備忘</category>
	<pubDate>Mon, 28 Nov 2005 13:24:26 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]Sql Transaction</title>
	<description><![CDATA[
			SqlTransaction myTrans = null;SqlConnection conn = new SqlConnection(Config.CONN_STRING);conn.Open();try{       myTrans = conn.BeginTransaction();       SqlCommand cmd = new SqlCommand();       cmd.Transaction=myTrans;       cmd.Connection=conn;       string sql = &quot;&quot;;                                                                                       cmd.CommandText=sql;       cmd.ExecuteNonQuery();       myTrans.Commit();}catch(Exception exp){       myTrans.Rollback();       Response.Write(exp.Message);}
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>SqlTransaction myTrans = null;<br />SqlConnection conn = new SqlConnection(Config.CONN_STRING);<br />conn.Open();<br />try<br />{<br />       myTrans = conn.BeginTransaction();<br />       SqlCommand cmd = new SqlCommand();<br />       cmd.Transaction=myTrans;<br />       cmd.Connection=conn;<br /><br />       string sql = &quot;&quot;;<br />                                                                                <br />       cmd.CommandText=sql;<br />       cmd.ExecuteNonQuery();<br />       myTrans.<strong>Commit</strong>();<br />}</p><p>catch(Exception exp)<br />{<br />       myTrans.<strong>Rollback</strong>();<br />       Response.Write(exp.Message);<br />}<br /></p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/766926.html</link>
	<guid>http://blog.roodo.com/soboring/archives/766926.html</guid>
	<category>筆記備忘</category>
	<pubDate>Tue, 22 Nov 2005 21:22:24 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]呼叫函式出現「指定的轉換無效」的錯誤</title>
	<description><![CDATA[
			ASP.NET在呼叫函式時，有時候會出現「指定的轉換無效」這個錯誤，其出現原因可能是整隻專案在不同函式當中，出現的變數名稱過多重覆，ASP.NET在compile 產生  assembly code 的時候，.net framework常會出現「指定的轉換無效」的錯誤；所以不同副程式之間，變數的命名不宜重複性過高。另外呼叫函式亦儘量不要用到強制轉換。HTML                                                                                &lt;%# getDownload(DataBinder.Eval(Container.DataItem,&quot;COURSE_NO&quot;)) %&gt;                                                                                裡頭儘量不要用到強制轉換，在副程式當中再行轉換                                                                                Codebehind  C#                                                                                                                                                                protected string getDownload(object getCourse_no){string download=null;SqlConnection myConnection = new SqlConnection( Config.CONN_STRING );DataSet myDS = new DataSet();string sql =  &quot;select * from COURSE_HANDOUT where COURSE_NO = '&quot;+getCourse_no.ToString() +&quot;'&quot;;SqlDataAdapter myDA = new SqlDataAdapter(sql, myConnection);myDA.Fill(myDS,&quot;DOWN&quot;);if(myDS.Tables[&quot;DOWN&quot;].Rows.Count&gt;0){     for(int i=0;i&lt; myDS.Tables[&quot;DOWN&quot;].Rows.Count;i++)     {            download += &quot;&lt;a href=\&quot;Document\\&quot;+myDS.Tables[&quot;DOWN&quot;].            Rows[i][&quot;PATH&quot;].ToString()+&quot;\&quot;&gt;文件&quot;+(i+1)+&quot;&lt;/a&gt;&quot;+&quot;｜&quot;;     }}else { download = &quot;無提供下載文件&quot;;}return download;}
		]]>
	</description>
	<content:encoded><![CDATA[
			ASP.NET在呼叫函式時，有時候會出現「指定的轉換無效」這個錯誤，其出現原因可能是整隻專案在不同函式當中，出現的變數名稱過多重覆，ASP.NET在compile 產生  assembly code 的時候，.net framework常會出現「指定的轉換無效」的錯誤；所以不同副程式之間，變數的命名不宜重複性過高。另外呼叫函式亦儘量不要用到強制轉換。<br /><br />HTML<br />                                                                                <br />&lt;%# getDownload(DataBinder.Eval(Container.DataItem,&quot;COURSE_NO&quot;)) %&gt;<br />                                                                                <br />裡頭儘量不要用到強制轉換，在副程式當中再行轉換<br />                                                                                <br />Codebehind  C#<br />                                                                                <br />                                                                                <br />protected string getDownload(<strong>object</strong> getCourse_no)<br />{<br />string download=null;<br />SqlConnection myConnection = new SqlConnection( Config.CONN_STRING );<br />DataSet myDS = new DataSet();<br />string sql =  &quot;select * from COURSE_HANDOUT where COURSE_NO = '&quot;+<strong>getCourse_no.ToString()</strong> +&quot;'&quot;;<br />SqlDataAdapter myDA = new SqlDataAdapter(sql, myConnection);<br />myDA.Fill(myDS,&quot;DOWN&quot;);<br />if(myDS.Tables[&quot;DOWN&quot;].Rows.Count&gt;0)<br />{<br />     for(int i=0;i&lt; myDS.Tables[&quot;DOWN&quot;].Rows.Count;i++)<br />     {<br />            download += &quot;&lt;a href=\&quot;Document\\&quot;+myDS.Tables[&quot;DOWN&quot;].<br />            Rows[i][&quot;PATH&quot;].ToString()+&quot;\&quot;&gt;文件&quot;+(i+1)+&quot;&lt;/a&gt;&quot;+&quot;｜&quot;;<br />     }<br />}<br />else { download = &quot;無提供下載文件&quot;;}<br />return download;<br />}<br /><br /><br />
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/705715.html</link>
	<guid>http://blog.roodo.com/soboring/archives/705715.html</guid>
	<category>筆記備忘</category>
	<pubDate>Thu, 10 Nov 2005 18:27:46 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]檔案上傳的方法</title>
	<description><![CDATA[
			if( ( File1.PostedFile != null ) &amp;&amp; ( File1.PostedFile.ContentLength &gt; 0 ) ){      string fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);      string SaveLocation = Server.MapPath(&quot;Document&quot;) + &quot;\\&quot; +  fn;      try     {             File1.PostedFile.SaveAs(SaveLocation);          Response.Write(&quot;The file has been uploaded.&quot;);      }      catch ( Exception exp )      {          Response.Write(&quot;Error: &quot; + exp.Message);      }}else{     Response.Write(&quot;Please select a file to upload.&quot;);}PS: ASP.NET 只允許將 4,096 KB（即 4 MB）以下的小檔案，較大文件有大文件的上傳方式
		]]>
	</description>
	<content:encoded><![CDATA[
			if( ( File1.PostedFile != null ) &amp;&amp; ( File1.PostedFile.ContentLength &gt; 0 ) )<br />{<br />      string fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);<br />      string SaveLocation = Server.MapPath(&quot;Document&quot;) + &quot;\\&quot; +  fn;<br />      try<br />     {   <br />          File1.PostedFile.SaveAs(SaveLocation);<br />          Response.Write(&quot;The file has been uploaded.&quot;);<br />      }<br />      catch ( Exception exp )<br />      {<br />          Response.Write(&quot;Error: &quot; + exp.Message);<br />      }<br />}<br />else<br />{<br />     Response.Write(&quot;Please select a file to upload.&quot;);<br />}<br /><br />PS: ASP.NET 只允許將 4,096 KB（即 4 MB）以下的小檔案，較大文件有<a href="http://support.microsoft.com/?scid=kb;zh-cn;323246">大文件的上傳方式</a><br />
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/705684.html</link>
	<guid>http://blog.roodo.com/soboring/archives/705684.html</guid>
	<category>筆記備忘</category>
	<pubDate>Thu, 10 Nov 2005 18:20:32 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]如何更新DataSet中的資料</title>
	<description><![CDATA[
			許多情況下，我們須對DataSet當中的資料作新增與修正的的方式，因為DataAdapter所提供的Fill method 會蓋掉DataSet中原本所存有的資料，所以當我想要取得更新後的資料須透過間接的方法：額外建立一個DataSet放更新的資料，再透過DataSet所提供的Merge method作更新。DataSet myDS = new DataSet();DataSet myDS2 = new DataSet();SqlDataAdapter myDA = SqlDataAdapter(sql, conn);myDA.Fill(myDS, &quot;table&quot;);myDS2.Merge(myDS, myDS2);
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>許多情況下，我們須對DataSet當中的資料作新增與修正的的方式，因為DataAdapter所提供的Fill method 會蓋掉DataSet中原本所存有的資料，所以當我想要取得更新後的資料須透過間接的方法：額外建立一個DataSet放更新的資料，再透過DataSet所提供的Merge method作更新。<br /><br />DataSet myDS = new DataSet();<br />DataSet myDS2 = new DataSet();<br />SqlDataAdapter myDA = SqlDataAdapter(sql, conn);<br />myDA.Fill(myDS, &quot;table&quot;);<br />myDS2.Merge(myDS, myDS2);</p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/704356.html</link>
	<guid>http://blog.roodo.com/soboring/archives/704356.html</guid>
	<category>筆記備忘</category>
	<pubDate>Thu, 10 Nov 2005 12:35:01 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]判定Datagrid中checkbox是否選取的方法</title>
	<description><![CDATA[
			前端                                                                                    &lt;asp:TemplateColumn HeaderText=&quot;入選&quot;&gt;    &lt;ItemTemplate&gt;    &lt;INPUT id=chkSTU_ID type=checkbox value='                &lt;%# DataBinder.Eval(Container.DataItem, &quot;STU_ID&quot;) %&gt;'                        runat=&quot;server&quot; NAME=&quot;chkSTU_ID&quot;&gt;    &lt;/ItemTemplate&gt;    &lt;/asp:TemplateColumn&gt;後端C#for(int i = 0; i&lt;dgStudent.Items.Count; i++){   HtmlInputCheckBox app_no =(HtmlInputCheckBox)dgStudent.Items[i].FindControl(&quot;chkSTU_ID&quot;);                                                                                   if(app_no.Checked)   {   }}
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>前端<br />                                                                                <br />    &lt;asp:TemplateColumn HeaderText=&quot;入選&quot;&gt;<br />    &lt;ItemTemplate&gt;<br />    &lt;INPUT <strong>id=chkSTU_ID</strong> type=checkbox value='<br />                &lt;%# DataBinder.Eval(Container.DataItem, &quot;STU_ID&quot;) %&gt;'<br />                        runat=&quot;server&quot; NAME=&quot;chkSTU_ID&quot;&gt;<br />    &lt;/ItemTemplate&gt;<br />    &lt;/asp:TemplateColumn&gt;<br /></p><p>後端C#</p><p>for(int i = 0; i&lt;dgStudent.Items.Count; i++)<br />{<br /><strong>   HtmlInputCheckBox app_no =(HtmlInputCheckBox)dgStudent.Items[i].FindControl(&quot;chkSTU_ID&quot;);</strong><br />                                                                                <br />   if(app_no.Checked)<br />   {<br />   }<br />}</p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/701746.html</link>
	<guid>http://blog.roodo.com/soboring/archives/701746.html</guid>
	<category>筆記備忘</category>
	<pubDate>Wed, 09 Nov 2005 22:12:30 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]Check資料查詢有無傳回資料的小技巧 Response.Write( alert() )</title>
	<description><![CDATA[
			做資料庫存取的時候，因初期開發資料庫常常會自行建置資料而導致key-in error等資料不一致的問題，以致於後來程式開發時有可能會遇上資料存取沒有結果而誤以為是所撰程式裡有bug，事實上可透過Response.Write(alert()) 這個小技巧來作進一步的確認。Response.Write(&quot;&lt;&quot;+&quot;script language ='Javascript'&gt;&quot;+Convert.ToChar(13));Response.Write(&quot;alert('&quot;+ dataReader[&quot;欄位名稱&quot;].ToString()+&quot;')&quot;+Convert.ToChar(13));Response.Write(&quot;&lt;/&quot;+&quot;script&gt;&quot;);此外，資料庫存取也會因自行建置資料而產生不等長的空白位元導致之後的查詢沒有結果，這個時候就可以透過 toTrim的字串處理函式來消除前後的空白字串。
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>做資料庫存取的時候，因初期開發資料庫常常會自行建置資料而導致key-in error等資料不一致的問題，以致於後來程式開發時有可能會遇上資料存取沒有結果而誤以為是所撰程式裡有bug，事實上可透過Response.Write(alert()) 這個小技巧來作進一步的確認。<br /><br />Response.Write(&quot;&lt;&quot;+&quot;script language ='Javascript'&gt;&quot;+Convert.ToChar(13));<br />Response.Write(&quot;alert('&quot;+ dataReader[&quot;欄位名稱&quot;].ToString()+&quot;')&quot;+Convert.ToChar(13));<br />Response.Write(&quot;&lt;/&quot;+&quot;script&gt;&quot;);<br /><br />此外，資料庫存取也會因自行建置資料而產生不等長的空白位元導致之後的查詢沒有結果，這個時候就可以透過 <strong>toTrim</strong>的字串處理函式來消除前後的空白字串。</p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/663474.html</link>
	<guid>http://blog.roodo.com/soboring/archives/663474.html</guid>
	<category>筆記備忘</category>
	<pubDate>Mon, 31 Oct 2005 23:48:55 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]多重資料控制項(例：RadioButtonList)連結資料庫的方法</title>
	<description><![CDATA[
			在ASP.Net中 Repeater、DataList、DataGrid、ListBox、CheckBoxList 、 RadioButtonList 控制項可以包含多筆資料的DataSet作DataBind，只要設定下列四個屬性即可完成：1. DataSource2. DataTextField : Item顯示的本文3. DataValueField : Item所代表的Value4. DataBind();== 以RadioButtonList為例 ==假設已建立一 myDataset的DataSet，其中建立名稱為Activity的資料表(table)radioButtonList.DataSource = myDataset.Tables[&quot;Activity&quot;];radioButtonList.DataTextField = myDS.Tables[&quot;Activity&quot;].Columns[&quot;欄位名稱&quot;].toString( );radioButtonList.DataValueField = myDS.Tables[&quot;Activity&quot;].Columns[&quot;欄位名稱&quot;].toString( );radioButtonList.DataBind();
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>在ASP.Net中<!--StartFragment --> Repeater、DataList、DataGrid、ListBox、CheckBoxList 、 RadioButtonList 控制項可以包含多筆資料的DataSet作DataBind，只要設定下列四個屬性即可完成：<br />1. DataSource<br />2. DataTextField : Item顯示的本文<br />3. DataValueField : Item所代表的Value<br />4. DataBind();<br /><br />== 以RadioButtonList為例 ==<br />假設已建立一 myDataset的DataSet，其中建立名稱為Activity的資料表(table)</p><p>radioButtonList.DataSource = myDataset.Tables[&quot;Activity&quot;];<br />radioButtonList.DataTextField = myDS.Tables[&quot;Activity&quot;].Columns[&quot;欄位名稱&quot;].toString( );<br />radioButtonList.DataValueField = myDS.Tables[&quot;Activity&quot;].Columns[&quot;欄位名稱&quot;].toString( );<br />radioButtonList.DataBind();</p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/663402.html</link>
	<guid>http://blog.roodo.com/soboring/archives/663402.html</guid>
	<category>筆記備忘</category>
	<pubDate>Mon, 31 Oct 2005 23:35:31 +0800</pubDate>
</item>
<item>
	<title>[ASP.Net]例外處理函式- InnerException</title>
	<description><![CDATA[
			在VS.Net的開發環境中，利用例外處理 try catch 結構時，系統所預設的錯誤訊息提供通常無法滿足在程式開發時所會面臨的多種狀況，所以在例外處理的類別裡還有另一個InnerException的函式，可以提供更細步的錯誤訊息，幫助程式設計師更快速找出程式中的bugs。[C#]    try    {        xxxxxxxxxxxxxx;    }    catch(Exception ex )    {        Response.Write(&quot;The following exception occurred: &quot;  + ex.ToString() );        //檢查更細節的例外處理- InnerException        while( ex.InnerException != null )        {            Response.Write(&quot;--------------------------------&quot;);            Response.Write(&quot;The following InnerException reported: &quot; + ex.InnerException.ToString() );            ex = ex.InnerException;        }    }
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>在VS.Net的開發環境中，利用例外處理 try catch 結構時，系統所預設的錯誤訊息提供通常無法滿足在程式開發時所會面臨的多種狀況，所以在例外處理的類別裡還有另一個InnerException的函式，可以提供更細步的錯誤訊息，幫助程式設計師更快速找出程式中的bugs。</p><p>[C#]</p><p>    try<br />    {<br />        xxxxxxxxxxxxxx;<br />    }<br />    catch(Exception ex )<br />    {<br />        Response.Write(&quot;The following exception occurred: &quot;  + ex.ToString() );<br /><strong>        //檢查更細節的例外處理- InnerException<br />        while( ex.InnerException != null )<br />        {<br />            Response.Write(&quot;--------------------------------&quot;);<br />            Response.Write(&quot;The following InnerException reported: &quot; + ex.InnerException.ToString() );<br />            ex = ex.InnerException;<br />        }<br /></strong>    }<br /></p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/soboring/archives/663318.html</link>
	<guid>http://blog.roodo.com/soboring/archives/663318.html</guid>
	<category>筆記備忘</category>
	<pubDate>Mon, 31 Oct 2005 23:27:50 +0800</pubDate>
</item>
</channel>
</rss>