小新二三事 二三事 電視精/戲院 ASP .NET 新手工作日誌

2009年7月28日星期二

工作日誌: active sync 抄 file 日

工作日誌: active sync 抄 file 日

去左警衛森嚴既公司做 software deploy

因為security concern, 要on-site compile file

惡夢開始...
以下反白

係d 慢到死既 notebook 同 desktop compile project
compile file 要係 notebook remote desktop 做
做完又要抄去desktop 再 active sync 去 PocketPC
去完 PocketPC 再要soft reset
再行一次test plan

講完都口x...
做足 1 日都未做完
chi sin

2009年7月25日星期六

恭喜阿康新屋入伙

恭喜阿康新屋入伙

阿康買左樓 (麗晶花園, 四百幾呎)

上手地板好正
間屋好多燈
Sony 新電視, ONKYO Amp, Philps BD Player
直銷中心 + 宜家 傢俬
$8XX 訂做木面 做書桌
service 勁正
一日起貨, Call VAN 送到樓下

旺角xx木行

下面張相就係 Sony 電視個 Remote

from
http://widget.dicdot.com/archives/11332

今日入伙
幫左佢執左一日屋
終於攪晒

2009年7月24日星期五

ASP.NET Code: Export Excel from Gridview Data

ASP.NET Code: Export Excel from Gridview Data

如何將GridView的內容匯出成Excel?
http://blog.blueshop.com.tw/lolota/archive/2007/02/25/49703.aspx

Add Code
GridView1.AllowSorting = False
GridView1.AllowPaging = False
GridView1.DataBind()
before
GridView1.RenderControl(hw)

ASP.NET Code: HOW TO: Send email using System.Net.Mail

ASP.NET Code: HOW TO: Send email using System.Net.Mail

Send Email using Gmail ASP.NET C# VB.NET
http://csharpdotnetfreak.blogspot.com/2009/06/aspnet-send-email-using-gmail.html
using username and password in code

Sending Email with System.Net.Mail
http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx
using SMTP setting in web.config

ASP.NET內抓取網址的方式一覽表(Request)
http://demo.tc/view.aspx?id=230
Request.Url.Query[id]

http://digitalcolony.com/2007/08/sending-email-in-aspnet-using-smtp.aspx
http://www.jscape.com/articles/sending_email_using_vb.html

2009年7月20日星期一

2009-07-19 下午 逃學威龍

2009-07-19 星期日下午 逃學威龍

cut 左幾多

宜家開始數正字睇左幾多次

正字:1

2009年7月19日星期日

九號風球 莫拉菲 吹到寬頻,電話都斷

九號風球 莫拉菲 吹到寬頻,電話都斷

莫拉菲
莫拉菲死樣


潘蔚林 @ 八號風球

more news@ 天氣部落
http://typhoon-blogger.blogspot.com/

2009-07-18 半夜 NANA 世上的另一個我

2009-07-18 半夜 NANA 世上的另一個我

首歌幾好聽



小松奈奈好似我以前一個同事
笑個陣

http://zh.wikipedia.org/w/index.php?title=Nana_(%E9%9B%BB%E5%BD%B1)&variant=zh-tw

2009-07-18 夜晚 哈利波特阿茲卡班的逃犯

2009-07-18 夜晚 哈利波特阿茲卡班的逃犯

哈利波特阿茲卡班的逃犯
睇左下半
有問題: 老鼠人去左邊?

http://zh.wikipedia.org/wiki/%E5%93%88%E5%88%A9%E6%B3%A2%E7%89%B9%E2%80%94%E9%98%BF%E8%8C%B2%E5%8D%A1%E7%8F%AD%E7%9A%84%E9%80%83%E7%8A%AF_(%E9%9B%BB%E5%BD%B1)

2009-07-18 夜晚 獨家試愛

2009-07-18 夜晚 獨家試愛

獨家試愛
方力申食好野la...
鄧麗欣都幾淒涼
阿媽睇到唔食飯

http://zh.wikipedia.org/wiki/%E7%8D%A8%E5%AE%B6%E8%A9%A6%E6%84%9B

其實套戲同個女仔係APM 睇過
不過我同個女仔無下文...

係屋企睇番...
唔知點

2009年7月18日星期六

工作日誌: Client PC config @ 2009-07-18

工作日誌: Client PC config @ 2009-07-18

INTEL E5300 2.6GHZ 2M FSB800
MSI G31TM-P35 G31 MAINBOARD
KINGSTON 2GB 800 DD2 RAM
HITACHI 320GB SATA2
PHILIPS 22X IDE DVD-RW
COOLER MASTER RC-360 ATX CASE
2THEMAX MAXTRON POWER 420W
C-WIN XP HOME
LOGITECH EASY DESKTOP DELUXE
19" BENQ T902 LCD MONITOR

by Franky

ASP.NET Code: MasterPage.master Concept

ASP.NET Code: MasterPage.master Concept

MasterPage.master Concept

http://www.packtpub.com/article/asp.net-3.5-cms-adding-security-and-membership-part1

http://blog.xuite.net/jayhunglai/Jblog/245379

How to add MasterPage to existing page?

http://forums.asp.net/p/881332/910714.aspx

Blogger Code: 簡單的Blogger code block的方法(貼程式碼)

簡單的Blogger code block的方法(貼程式碼)

http://hsiangyuwang.blogspot.com/2009/03/blogger-code-block.html

ASP.NET Code: /admin Acces Right

ASP.NET Code: /admin Acces Right

ASP.NET Web 應用程式管理員
安全性
存取規則
建立存取規則

會生一個 Web.config 係 /admin


<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<allow users="admin" />
<deny users="?" />
<deny users="*" />
</authorization>
</system.web>
</configuration>


http://www.packtpub.com/article/asp.net-3.5-cms-adding-security-and-membership-part1

http://www.packtpub.com/article/asp.net-3.5-cms-adding-security-and-membership-part2

2009年7月17日星期五

ASP.NET Code: www.qsh.eu ASPNETDB.MDF

ASP.NET Code: www.qsh.eu ASPNETDB.MDF


<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;Database=www.qsh.eu_8a547bfd-ce62-405a-bbfe-1628ac48aa15;AttachDBFilename=|DataDirectory|ASPNETDB.MDF" />
</connectionStrings>


http://forum.qsh.eu/Forums.aspx?forumid=25&threadid=79

http://forum.qsh.eu/Forums.aspx?searchtext=aspnet

http://www.cnblogs.com/hardrock/archive/2007/11/13/958546.html

ASP.NET Code: www.qsh.eu ConnectionString

ASP.NET Code: www.qsh.eu ConnectionString
For examle you have database "Test.mdf" created at SQL Server Management Studio Express.

1st step: your database must be detached from your SQL server correctly: open management studio -> right click on "Test" database -> Tasks -> Detach.

2nd step: create folder www/App_Data and copy Test.mdf without log file.

3 step: generate connection string at https://www.qsh.eu/admin/EditFreehosting.aspx and save in web.config.

4 step: replace name="LocalSqlServer" with (for example) name="DBAccess".

5 step: in code you can read connection string from web.config:

string connectionString = ConfigurationManager.ConnectionStrings["DBAccess"].ConnectionString;
IDbConnection connection = new SqlConnection(connectionString);
OR
replace name="DBAccess" with (for example) name="LocalSqlServer" in all ASPX
the stupid method i did once...

Login Link for www.qsh.eu
https://www.qsh.eu/admin/Login.aspx

免費asp.net空間(www.qsh.eu)使用詳解
http://www.0379zd.com/news/show/17001.htm

Qantasoft qsh.eu webconfig connectionString problem
http://forums.asp.net/p/1253493/2356606.aspx#2356606

2009年7月16日星期四

電腦 Eason: 3 流動寬頻 Mobile Partner 出現 Error 720

電腦 Eason: 3 流動寬頻 Mobile Partner 出現 Error 720

E176G
HUAWEI Mobile Broadband HSPA USB Stick

EasyPlus 流動數據月費計劃 (適用於 USB Modem)
http://www.three.com.hk/website/appmanager/three/home?_nfpb=true&pageid=222001&_pageLabel=P200470391219567710594&lang=chi

Problem:
After install Mobile Partner
Connect 出現 Error 720:

Solution:
  • remove WAN Minport (PPTP), WAN Minport (IP)
  • change netrasa.inf
  • install again
more steps at
http://forums.lenovo.com/lnv/board/message?board.id=Special_Interest_Windows&thread.id=398

2009年7月15日星期三

工作日誌: 攝影日

工作日誌: 攝影日

今日幫過客 搵左 攝影師 同 小妹妹做 Model,
小妹妹簡直係明日之星
不過我覺得讀書緊要多d

小妹妹,要努力讀書!

2009年7月14日星期二

ASP.NET Code: SqlConnection with ConnectionString

ASP.NET Code: SqlConnection with ConnectionString
Dim SQLData As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\db.mdf;Integrated Security=True;User Instance=True")
Dim SQLData As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("
dbConnectionString
").ConnectionString)
from
http://www.aspnet101.com/aspnet101/tutorials.aspx?id=64

2009年7月11日星期六

ASP.NET Step: Move / Export Database from Microsoft SQL Server 2008 to mdf File

ASP.NET Step: Move / Export Database from Microsoft SQL Server 2008 to mdf File

1. Download SQL Server Management Studio
from VWD website

2. Read the followings doc
http://www.windows-tech.info/15/206f0457374acafb.php

3. Follow Steps in
How to: Detach a Database (SQL Server Management Studio)
http://msdn.microsoft.com/en-us/library/ms191491.aspx

4. Copy the mdf to VWD website's App_Data Folder
from
C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA

5. Open Web.config
Replace the connection String as we detached the database from server
and run it as standalone file

<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\db.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />

ASP.NET Warning: 具有潛在危險 Request.Form 的值已從用戶端偵測到

ASP.NET Warning: 具有潛在危險 Request.Form 的值已從用戶端偵測到

具有潛在危險 Request.Form 的值已從用戶端偵測到

若是出現這樣的錯誤訊息,代表頁面上有文字內容是包含Html這類的語法,通常在使用一些Html的編輯器(留言板、討論區之類常用)做資料送出的動作的時候會發生。

解決辦法如下:

在頁面的Page指示語加入 validateRequest="false"


http://blog.blueshop.com.tw/greenwings/archive/2007/02/22/49690.aspx

ASP.NET Warning: 並未將物件參考設定為物件的執行個體

ASP.NET Warning: 並未將物件參考設定為物件的執行個體

System.NullReferenceException:
並未將物件參考設定為物件的執行個體

通常...這種錯誤就是
"使用了某種物件, 但卻未宣告"
朝這個方向去找吧, 仔細檢查一下程式裡面有沒有哪裡有這樣的情形
該用new 沒有new

如果用的是vs.net2003...
那這個錯誤下中斷點,瞬間就能找出

2009年7月10日星期五

ASP.NET Code: SQL SELECT command based on DropDownList

ASP.NET Code: SQL SELECT command based on DropDownList

SQL SELECT command based on DropDownList

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:dbConnectionString %>"
SelectCommand="SELECT * FROM [menu] WHERE (([region] = @region) AND ([lang] = @lang)) ORDER BY [menuId]"
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="region"
PropertyName="SelectedValue" Type="String" />
<asp:Parameter DefaultValue="1" Name="lang" Type="String" />
</SelectParameters>

ASP.NET Warning: Cannot insert explicit value for identity column in table 'Table' when IDENTITY_INSERT is set to OFF

ASP.NET Warning: Cannot insert explicit value for identity column in table 'Table' when IDENTITY_INSERT is set to OFF

Things to check

1. Set table id as (Is Identity) to Yes
1a. Set table id as (Primary Key)

2. Make a new SqlDataSource with INSERT command
Coz after you change table id, SqlDataSource will not be updated auto.

3. Check the INSERT command with original SqlDataSource
Should have difference

ASP.NET Code: Server.MapPath

ASP.NET Code: Server.MapPath

Dim PathName As String
Dim FileName As String
PathName = LangPath & "/collection" & cat & ".xml"
FileName = Server.MapPath(PathName)
http://fuchangmiao.blogspot.com/2008/11/aspnet-path.html

2009年7月9日星期四

XP IIS 5.1 + ASP.NET 3.5 setup

XP IIS 5.1 + ASP.NET 3.5 setup

http://www.mobile01.com/topicdetail.php?f=300&t=966120

1. download dotnetfx35.exe 197MB
http://go.microsoft.com/?linkid=7755937

2. reinstall IIS

3. run aspnet_regiis.exe -i

4. check ASP.NET runtime 2.0

5. open IE @ http://localhost/
確定連結裡的都沒問題
http://timstall.dotnetdevelopersjournal.com/resolving_http_500_server_errors_in_aspnet_and_iis_51.htm

主要是下列幾項
1. 用command line 到
C:\WINDOWS\Microsoft.NET\Framework\vv2.0.50727 目錄下執行
aspnet_regiis.exe -i

2. 然後確定你的虛擬目錄 使用 .net framework 2.0
到IIS管理介面
滑鼠右鍵 看你的虛擬目錄是否 使用2.0

3. 然後再看extension裡是否有允許
2.0的plugin

XP IIS 5.1 "拒絕存取路徑"的問題

XP IIS 5.1 "拒絕存取路徑"的問題

http://social.msdn.microsoft.com/Forums/zh-TW/236/thread/25ef53b6-656f-42b5-b0e7-0a61e6a8a45b

1. right click C:\Inetpub\wwwroot\WebSite1

2. 內容、安全性、新增使用者 ASPNET ,並授與 ASPNET 寫入權限。
你要把你要存放檔案的存取權限(修改與寫入權限)設定給 ASPNET 帳戶才可以。
錯誤訊息的內容就是在告訴你這件事。

從VS2005去執行(開始偵錯)的話就可以,
VS2005 有虛擬伺服器,假定你網頁專案開在虛擬伺服器上的話,不需要管到權限問題,若是你網頁專案直接開在 IIS 上或是執行實體網站時,就會碰上權限問題。 所以請用檔案總管,把 Session("Path") 的路徑用滑鼠右鍵,內容、安全性、新增使用者 ASPNET ,並授與 ASPNET 寫入權限。