Q: 如何輸入UniCode內碼,以輸出字串?
A: Console.WriteLine(ChrW(&H4EBA))
Q: 如何查詢中文字的UniCode內碼?
A: 在這個網站輸入中文即可
2010年7月10日 星期六
UniCode Information
2010年3月24日 星期三
Move Column position in Data Table
Q: How to Insert Data Column in a specified position, instead of appending to last column?
A: DataTable.Columns.Add does not support it. We need to adjust the position after adding the column. The sample code is listed as below:
Dim mColumn As New DataColumn("Column1")
Table1.Columns.Add(mColumn)
mColumn.SetOrdinal(0)
2010年1月21日 星期四
2009年9月16日 星期三
在Form_load事件中關閉表單
Q: 在Form_load事件中關閉表單,會造成程式錯誤,該如何解決?
A: 利用 Timer,在 Timer.Tick 事件中關閉表單,程式如下:
' close form since it cannot call me.close in form_load
Private WithEvents Timer1 As New Timer
Private Sub Timer1_Timer() Handles Timer1.Tick
Me.Close()
End Sub
Private Sub Form_Load(ByVal sender, ByVal e As System.EventArgs) Handles Me.Load
MsgBox(objTEJErrorMessage.GetLocalString("EA009_NoAccessRight").ToString)
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
2009年5月26日 星期二
Msg 3623, Level 16 error in SQL Server
今天執行一個 SQL 指令, 產生下列錯誤訊息:
Msg 3623, Level 16, State 1, Procedure sp0_anprcd_growth, Line 123發生網域錯誤。
查了老半天, 原來是數學運算有錯, 天啊. 這是哪一國的錯誤提示?
指令如下:
select a.證券代碼 , a.證券代碼 + ' ' + max(c.證券中文簡稱) as 證券 , POWER(CAST(10 AS FLOAT),SUM(LOG10(1+[報酬率%]))) as [股價漲跌%] , sum(case 日期 when a.EndDate then b.[收盤價(元)] end) as [迄日收盤價(元)] from #anprcd_1 a, view_anprcd b , view_astkind c where a.證券代碼=b.證券代碼 and a.證券代碼=c.證券代碼 and b.日期 >= a.StartDate and b.日期 <= a.EndDate group by a.證券代碼 order by [股價漲跌%] desc
應修正為
POWER(CAST(10 AS FLOAT),SUM(LOG10(1+[報酬率%]/100)))
感謝恩公如下:
http://www.sql-server-performance.com/faq/domain_error_occurred_p1.aspx
2008年12月31日 星期三
如何在.net程式中加密, Java程式中解密(Encode in .net and decode in java)
Q: 如何在.net程式中加密, Java程式中解密?
A:
.net:
Imports System.Web
...
Me.TextBox2.Text = HttpUtility.UrlEncode(Me.TextBox1.Text)
Java:
import java.net.*;
public class EncodeDecode{
public static void main(String[] args) {
System.out.println= URLDecoder.decode(args[0], "UTF-8");
}
}
2008年11月20日 星期四
以 VS 2008 製作 .net framework 2.0 的安裝專案
Q: IDE 採 VS 2008, 但專案以 .net framework 2.0 開發, 但執行安裝檔時卻需安裝 .net framework 3.5, 應如何處理 ?