2014年12月8日 星期一

Repeater在後端時,可用foreach來取得所有Repeater裡的物件

foreach (RepeaterItem RPItem in this.Repeater.Items) { ((TextBox)RPItem.FindControl("TextBox")).Text="aa"; }

DropDownList動態給值

在後端處理中,要動態給予DropDownList的值時,需注意以下幾點 1.需先行清除已選定的值: DropDownList.ClearSelection(); 2.找出Value或Text值給予設定 DropDownList.Items.FindByValue(要設定的值).Selected = true; DropDownList.Items.FindByText(要設定的值).Selected = true;

2014年9月16日 星期二

ReportView在Google Chrome中如果顯示有異常

ReportView在Google Chrome中如果顯示有異常,可在報表元件中增加ZoomMode="PageWidth" 和SizeToReportContent="True"屬性

例如:

 <rsweb:ReportViewer ID="ReportViewer" runat="server" Width="100%" Height="100%" ZoomMode="PageWidth" SizeToReportContent="True"></rsweb:ReportViewer>

2014年7月8日 星期二

SQL SERVER 2008R2 的轉送交易紀錄(Log Shipping)

在設定轉送交易紀錄時,需要建立一個網路分享目錄,提供給次要伺服器讀取備份資料,
在主體及次要伺服器的SQL Server和SQL Server Agent的服務啟動帳號必須調整,
如果是網域架構建議要設成網域的帳號並在分享目錄的權限中需加入主體及次要的SQL Server和SQL Server Agent的服務啟動帳號,如果是使用本機帳號,則主體及次要必須要有相同帳號密碼的帳號並設為SQL Server和SQL Server Agent的服務啟動帳號.



如果要啟用次要伺服器上的資料庫,須先停止Log Shipping,然後在次要資料庫中的master中,使用RESTORE DATABASE dbname WITH RECOVERY將資料庫從還原狀態變成啟用狀態





2014年7月2日 星期三

在Windows中如果分割區想要延伸,可使用diskpart命令

在CMD模式中,輸入diskpart
1.先使用list disk來檢視要處理的硬碟
2.select disk # 選擇要處理的硬碟
3.list partition檢視要處理的分割區
4.select partition #選擇要處理的分割區
5.extend既可

若要在 Windows Web Server 2008 R2 上安裝 [DFS 複寫]

必須手動輸入OCSetup DFSR-Infrastructure-ServerEdition 命令

2014年6月5日 星期四

Windows2008 FTP防火牆設定

Windows2008的IIS版本為7.0,FTP只能使用IIS6.0的模式,可到http://www.iis.net/learn/get-started/whats-new-in-iis-7/what39s-new-for-microsoft-and-ftp-in-iis-7
下載新的FTP7.5的元件,但是要使用Passive Mode時須在防火牆加入以下規則
使用管理員權限的cmd模式,輸入以下防火牆規則

netsh advfirewall firewall add rule name=”FTP Service” action=allow service=ftpsvc protocol=TCP dir=in


netsh advfirewall set global StatefulFTP disable

就可以在防火牆開啟時使用FTP