20120428
環境
win7 & visual studio 2008
IT8000盤點機
1.在win7環境下只要把智慧型裝罝連結到電腦,win7就會自動搜尋並安裝windows mobile裝置中心。
2.在開發工具部份VS2010好像不能開發智慧型裝置,VS2005和VS2008可以。
3.新增專案時請選擇智慧型裝置,因為IT8000平台為WinCE 5.0,所以我選擇的平台為WinCE 5.0,下面是VS2005的畫面。
如果是VS2008,選擇完智慧型裝置專案後,請再選擇裝置應用程式範本,目標平台選擇WindowsCE。
因為我是用VS2008開發的,在這裡我遇到了一個問題,因為VS2008預設的Framework範本是3.5,所以當我將程式放上IT8000時一直出現Framework版本的錯誤訊息,原來在IT8000上是Framework 2.0,所以在新增專案時要選.NET Compact Framework version 2.0。
4.開發WinCE程式時其實和開發WinForm差不多,只是在WinCE上有很多功能沒有支援 ><",有點不方便。
20120430
WinCE不像WinForm有mdi的功能,但還是有方式可以達成
在MainForm中開啟ChildForm時加上
ChildForm.parent = me
ChildForm.show()
20120508
資料庫使用SQL Compact
使用版本 Sql Compact 3.5, 所以要加入參考 System.Data.SqlServerCe 3.5.0.0
在 WinCE 上也必需安裝 SqlCE 5.0
安裝方式:複製本機上的 sqlce.wce5.armv4i.cab 到 WinCE 上再執行安裝
檔案路徑在:C:\program files\microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i\
資料庫使用SQLite
先下載 SQLite for ADO.NET 2.0
安裝好後把System.Data.Sqlite加入參考
在WinCE上必需把本機上的C:\Program Files\SQLite.NET\bin\CompactFramework\SQLite.Interop.066.dll複製過去並重新命名為SQLite.Interop.dll
不然執行時會出現錯誤訊息:找不到Pinvode.dll SQLite.Interop.dll
2012年4月28日 星期六
2012年3月7日 星期三
ASP.NET 3.5 使用 AjaxControlToolkit
某次正開心的寫著 ASP.NET 3.5 網站
要加入 AjaxControlToolkit~
看著左邊工具箱很自然的把 AJAX 擴充功能中的 ScriptManager 拉進網頁
正當我開開心心的把 CalendarExtender 拉入 TextBox 控制項時
執行網頁時卻發現日期無法出現
在 IE 中開啟檢視網頁程式碼發現了
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax 用戶端架構無法載入。');
原來 ScriptManager 是要加入 AjaxControlToolkit 的 ToolkitScriptManager 才行!!!
要加入 AjaxControlToolkit~
看著左邊工具箱很自然的把 AJAX 擴充功能中的 ScriptManager 拉進網頁
正當我開開心心的把 CalendarExtender 拉入 TextBox 控制項時
執行網頁時卻發現日期無法出現
在 IE 中開啟檢視網頁程式碼發現了
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax 用戶端架構無法載入。');
原來 ScriptManager 是要加入 AjaxControlToolkit 的 ToolkitScriptManager 才行!!!
2012年3月5日 星期一
ASP.NET + Windows Server 2008 + IIS7 小筆記
最近使用在 IIS7 上遇到了幾個小問題
來做個筆記~記錄一下
1. Access 資料庫,當網頁執行新增、修改、刪除動作時出現了 "運作必須使用更新查詢" 的錯誤訊息; 原因為 Access 檔案使用權限不足,把 user 的權限開放完全控制。
2. 網站中的圖示均無法顯示, 原因為沒有對目錄中的文件使用權限不足, 在 web.config 中加入
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
來做個筆記~記錄一下
1. Access 資料庫,當網頁執行新增、修改、刪除動作時出現了 "運作必須使用更新查詢" 的錯誤訊息; 原因為 Access 檔案使用權限不足,把 user 的權限開放完全控制。
2. 網站中的圖示均無法顯示, 原因為沒有對目錄中的文件使用權限不足, 在 web.config 中加入
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
2009年9月30日 星期三
ASP.NET - IBM DB2 工具列
原來~ 要在 Visual Studio 裡使用 DB2 Connection 來連結資料庫
一定要先裝好 DB2 後再安裝 Visual Studio
這樣 VS 就會自動將 DB2 工具列加進來了!
20091007補充:
其實只要先裝好資料庫再裝 VS
VS 就會自動將資料庫工具列加入!
一定要先裝好 DB2 後再安裝 Visual Studio
這樣 VS 就會自動將 DB2 工具列加進來了!
20091007補充:
其實只要先裝好資料庫再裝 VS
VS 就會自動將資料庫工具列加入!
2009年9月29日 星期二
ASP.NET - 上傳檔案到資料庫
在 APS.NET 1.1 裡要將檔案存到資料庫!!??
因為專案裡所使用的資料庫為 DB2 , 所以必需將儲存檔案的欄位設為 BLOB 以儲存 Binary 的資料
我這次要存的檔案為 pdf 檔, 所以先利用 CrystalReport 產生好 pdf 後,
再讀取 pdf 檔並轉成 Binary, 存入資料庫
Dim myFileStream As New System.IO.FileStream("abc.pdf", IO.FileMode.Open, IO.FileAccess.Read)
Dim myBinaryReader As New System.IO.BinaryReader(myFileStream)
Dim bteRead() As Byte = myBinaryReader.ReadBytes(myFileStream.Length)
Dim MyConnection As New System.Data.oledb.oledbConnection("連線字串")
Dim MyCommand As New System.Data.oledb.oledbCommand
MyConnection.Open()
MyCommand.Connection = MyConnection
MyCommand.CommandText = "insert into TableName(sFile) Values(?) "
MyCommand.Parameters.Add("sFile", oledb.oledbType.Binary).Value = bteRead
MyCommand.ExecuteReader()
MyConnection.Close()
----------------------------------------------------------
從資料庫下載檔案:
Dim MyConnection As New System.Data.oledb.oledbConnection("連線字串")
Dim MyCommand As New System.Data.oledb.oledbCommand
MyConnection.Open()
MyCommand.Connection = MyConnection
MyCommand.CommandText = "select sFile from TableName"
Response.ClearHeaders()
Response.Clear()
Response.Expires = 0
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=abc.pdf")
Response.ContentType = "Application/octet-stream"
Response.BinaryWrite(MyCommand.ExecuteScalar)
MyConnection.Close()
'釋放資源
Response.End()
MyConnection.Open()
----------------------------------------------------------
那如果是在 ASP.NET 2.0 要上傳檔案至資料庫呢?
就可以使用 FileUpload 來達成, 可參考 如何在ASP.NET中上傳檔案到資料庫
因為專案裡所使用的資料庫為 DB2 , 所以必需將儲存檔案的欄位設為 BLOB 以儲存 Binary 的資料
我這次要存的檔案為 pdf 檔, 所以先利用 CrystalReport 產生好 pdf 後,
再讀取 pdf 檔並轉成 Binary, 存入資料庫
Dim myFileStream As New System.IO.FileStream("abc.pdf", IO.FileMode.Open, IO.FileAccess.Read)
Dim myBinaryReader As New System.IO.BinaryReader(myFileStream)
Dim bteRead() As Byte = myBinaryReader.ReadBytes(myFileStream.Length)
Dim MyConnection As New System.Data.oledb.oledbConnection("連線字串")
Dim MyCommand As New System.Data.oledb.oledbCommand
MyConnection.Open()
MyCommand.Connection = MyConnection
MyCommand.CommandText = "insert into TableName(sFile) Values(?) "
MyCommand.Parameters.Add("sFile", oledb.oledbType.Binary).Value = bteRead
MyCommand.ExecuteReader()
MyConnection.Close()
----------------------------------------------------------
從資料庫下載檔案:
Dim MyConnection As New System.Data.oledb.oledbConnection("連線字串")
Dim MyCommand As New System.Data.oledb.oledbCommand
MyConnection.Open()
MyCommand.Connection = MyConnection
MyCommand.CommandText = "select sFile from TableName"
Response.ClearHeaders()
Response.Clear()
Response.Expires = 0
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=abc.pdf")
Response.ContentType = "Application/octet-stream"
Response.BinaryWrite(MyCommand.ExecuteScalar)
MyConnection.Close()
'釋放資源
Response.End()
MyConnection.Open()
----------------------------------------------------------
那如果是在 ASP.NET 2.0 要上傳檔案至資料庫呢?
就可以使用 FileUpload 來達成, 可參考 如何在ASP.NET中上傳檔案到資料庫
2009年7月22日 星期三
SQL Server 2008 Express 無法遠端連線??
錯誤訊息:
provider: 具名的管線提供者, error: 40 - 無法開啟至 SQL Server 的連接
這個問題找了好久....
原來是 port 的問題
Express 不是預設的 1433 port , 我裝的機器裡是 1082 port
難怪怎麼連都連不到!!
查看 sql server 的 port :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\SuperSocketNetLib\Tcp
20100710 補充
在 sql server configuration manager 裡要把 TPC/IP 設為啟用才行
provider: 具名的管線提供者, error: 40 - 無法開啟至 SQL Server 的連接
這個問題找了好久....
原來是 port 的問題
Express 不是預設的 1433 port , 我裝的機器裡是 1082 port
難怪怎麼連都連不到!!
查看 sql server 的 port :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\SuperSocketNetLib\Tcp
20100710 補充
在 sql server configuration manager 裡要把 TPC/IP 設為啟用才行
訂閱:
意見 (Atom)







