document.getElementById("<%= TextBoxID.ClientID %>").value
網誌標籤
javascript get aspnet textbox value
刪除oracle user,tablespace,role 等資料
drop user invoice cascade; drop user exchange cascade; drop user his cascade; drop user einvoiceaccount cascade; drop user einvoicereader cascade;2.步驟2刪除tablespace 刪除user後,會將其擁有之table,view,procduce..等也一併刪除, 所以現在的tablespace理論上是一個空的表空間
drop tablespace invoice; drop tablespace exchange; drop tablespace his;3.步驟3刪除特殊建立之role..等,如aspnet provider會建立的role!
drop ROLE ORA_ASPNET_MEM_BASICACCESS; drop ROLE ORA_ASPNET_MEM_FULLACCESS; drop ROLE ORA_ASPNET_MEM_REPORTACCESS; drop ROLE ORA_ASPNET_PERS_BASICACCESS; drop ROLE ORA_ASPNET_PERS_FULLACCES; drop ROLE ORA_ASPNET_PERS_REPORTACCESS; drop ROLE ORA_ASPNET_PROF_BASICACCESS; drop ROLE ORA_ASPNET_PROF_FULLACCESS; drop ROLE ORA_ASPNET_PROF_REPORTACCESS; drop ROLE ORA_ASPNET_ROLES_BASICACCESS; drop ROLE ORA_ASPNET_ROLES_FULLACCESS; drop ROLE ORA_ASPNET_ROLES_REPORTACCESS; drop ROLE ORA_ASPNET_SESSN_FULLACCESS; drop ROLE ORA_ASPNET_SMAP_FULLACCESS; drop ROLE ORA_ASPNET_WEVNT_FULLACCESS;此資料庫只有建立自訂的tablespace 並建立user對應新建立之tablespace, 並無對應到其他原有tablespace, 因此只要刪除此兩部份,即可乾淨的環原未新增前狀態! 較特殊的是role 因為有用oracle for aspnet provider, 所以變會建立對應之role 所以也要一併刪除!
EXP / IMP Oracle 資料庫
C:\>exp system/bankpro@oracle9i file=C:\invoice.exp log=C:\invoice.log owner=invoice indexes=y rows=y constraints=y feedback=1000 tts_full_check=yIMP 資料庫 1.先以具DBA角色權限以上之使用者登入oracle資料庫
C:\>sqlplus system/bankpro@oracle9i2.執行Script,目的建立TableSpace & User
SQL> start c:\createtablespace.sql; CREATE TABLESPACE INVOICE DATAFILE 'C:\ORACLE\ORADATA\ORACLE9I\INVOICE.ORA' SIZE 200M AUTOEXTEND ON NEXT 1024M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO; CREATE USER INVOICE IDENTIFIED BY VALUES 'CC58BA69EDD100F1' DEFAULT TABLESPACE INVOICE TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; -- 17 Roles for INVOICE GRANT DBA TO INVOICE; GRANT CONNECT TO INVOICE; GRANT ORA_ASPNET_MEM_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_MEM_BASICACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_PERS_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_PROF_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_SMAP_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_MEM_REPORTACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_PERS_BASICACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_PROF_BASICACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_ROLES_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_SESSN_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_WEVNT_FULLACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_PERS_REPORTACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_PROF_REPORTACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_ROLES_BASICACCESS TO INVOICE WITH ADMIN OPTION; GRANT ORA_ASPNET_ROLES_REPORTACCESS TO INVOICE WITH ADMIN OPTION; ALTER USER INVOICE DEFAULT ROLE ALL; -- 5 System Privileges for INVOICE GRANT CREATE SESSION TO INVOICE; GRANT CREATE ANY TABLE TO INVOICE; GRANT SELECT ANY TABLE TO INVOICE; GRANT CREATE ANY PROCEDURE TO INVOICE; GRANT UNLIMITED TABLESPACE TO INVOICE;3.開始執行TableSpace的匯入
C:\>imp system/bankpro@oracle9i fromuser=INVOICE touser=INVOICE file=C:\invoice.exp log=C:\invoice.log ignore=y indexes=y rows=y constraints=y feedback=10004. 重建Role對應
-- 6 Object Privileges for INVOICE GRANT DELETE, INSERT, SELECT, UPDATE ON EXCHANGE.COMPANY TO INVOICE;GRANT DELETE, INSERT, SELECT, UPDATE ON EXCHANGE.SALESINVOICE TO INVOICE;GRANT DELETE, INSERT, SELECT, UPDATE ON EXCHANGE.SALESINVOICEDETAIL TO INVOICE;GRANT DELETE, INSERT, SELECT, UPDATE ON EXCHANGE.SALESINVOICENG TO INVOICE;GRANT DELETE, INSERT, SELECT, UPDATE ON HIS.B2CINVOICEACTIONHISTORY TO INVOICE;GRANT DELETE, INSERT, SELECT, UPDATE ON HIS.B2CINVOICEDETAILACTIONHISTORY TO INVOICE; -- 3 Object Privileges for EINVOICEACCOUNT GRANT DELETE, INSERT, SELECT, UPDATE ON EXCHANGE.COMPANY TO EINVOICEACCOUNT;GRANT DELETE, INSERT, SELECT, UPDATE ON HIS.B2CINVOICEACTIONHISTORY TO EINVOICEACCOUNT;GRANT DELETE, INSERT, SELECT, UPDATE ON HIS.B2CINVOICEDETAILACTIONHISTORY TO EINVOICEACCOUNT; GRANT ORA_ASPNET_MEM_BASICACCESS TO ORA_ASPNET_MEM_FULLACCESS;GRANT ORA_ASPNET_MEM_REPORTACCESS TO ORA_ASPNET_MEM_FULLACCESS;GRANT ORA_ASPNET_PERS_BASICACCESS TO ORA_ASPNET_PERS_FULLACCESS;GRANT ORA_ASPNET_PERS_REPORTACCESS TO ORA_ASPNET_PERS_FULLACCESS;GRANT ORA_ASPNET_PROF_BASICACCESS TO ORA_ASPNET_PROF_FULLACCESS;GRANT ORA_ASPNET_PROF_REPORTACCESS TO ORA_ASPNET_PROF_FULLACCESS;GRANT ORA_ASPNET_ROLES_REPORTACCESS TO ORA_ASPNET_ROLES_FULLACCESS;GRANT ORA_ASPNET_ROLES_BASICACCESS TO ORA_ASPNET_ROLES_REPORTACCESS;5.重建AspNet Provider
C:\>sqlplus system/bankpro@oralce9i將建置aspnet provider之script copy至c:\aspnet\路徑下!
SQL> start c:\aspnet\InstallAllOracleASPNETProviders.sql;6.將有錯誤之procduce & function重新編譯過後即可!
select 包含 Row_Number
select Row_Number() over (order by papdno) as RowNt,papdno from pm10d;[輸出] 1 pdno1 2 pdno2 3 pdno3 . . . 10 pdno10 將行數轉為字串,並補0 select right('00'+ltrim(Row_Number() over (order by papdno)),3) as RowNt ,papdno from pm10d; [輸出] 001 pdno1 002 pdno2 003 pdno3 . . . 010 pdno10
Restore Sql Server 系統資料表Master
用Sql分析Profiler錄下之Trace資料
IOC ( Inversion of Control )
IoC模式基本上是一個高層的概念,在 Martin Fowler 的 Inversion of Control Containers and the Dependency Injection pattern 中談到,實現IoC有兩種方式:Dependency Injection與Service Locator,Spring 所採用的是Dependency Injection 來實現 IoC,中文翻譯為依賴注入,依賴注入的意義是:「保留抽象介面,讓組件依賴於抽象介面,當組件要與其它實際的物件發生依賴關係時,藉過抽象介面來注入依賴的實際物件。」 看看下面這個程式:
public class BusinessObject { private FloppyWriter writer = new FloppyWriter(); .... public void save() { ... writer.saveToFloppy(); } }
BusinessObject 依賴於實際的 FloppyWriter,為了讓 BusinessObject 獲得重用性,不讓 BusinessObject 直接依賴於實際的 FloppyWriter,而是依賴於抽象的介面:
public interface IDeviceWriter { public void saveToDevice(); } public class BusinessObject { private IDeviceWriter writer; public void setDeviceWriter(IDeviceWriter writer) { this.writer = writer; } public void save() { .... writer.saveToDevice(); } } public class FloppyWriter implement IDeviceWriter { public void saveToDevice() { .... // 實際儲存至Floppy的程式碼 } } public class UsbDiskWriter implement IDeviceWriter { public void saveToDevice() { ....// 實際儲存至UsbDisk的程式碼 } }如果今天BusinessObject想要與UseDiskWriter物件發生依賴關係,可以這麼建立: businessObject.setDeviceWriter(new UsbDiskWriter()); 由於BusinessObject依賴於抽象介面,在需要建立依賴關係時,可以透過抽象介面注入依賴的實際物件。 依賴注入在Martin Fowler的文章中談到了三種實現方式:Interface injection、Setter injection 與 Constructor injection。並分別稱其為Type 1 IoC、Type 2 IoC 與 Type 3 IoC。 上面的BusinessObject所實現的是Type 2 IoC,透過Setter注入依賴關係,而Type 3 IoC,則在是建構式上注入依賴關係,例如:
public class BusinessObject { private IDeviceWriter writer; public BusinessObject(IDeviceWriter writer) { this.writer = writer; } public void save() { .... writer.saveToDevice(); } }Spring 鼓勵的是 Setter injection,但也允許您使用 Constructor injection,使用 Setter 或 Constructor 來注入依賴關係視您的需求而定,使用 Constructor 的好處之一是,您可以在建構物件的同時一併完成依賴關係的建立,然而如果要建立的物件關係很多,則會在建構式上留下一長串的參數,這時使用 Setter 會是個不錯的選擇,另一方面,Setter 可以有明確的名稱可以瞭解注入的物件會是什麼,像是setXXX()這樣的名稱會比記憶Constructor上某個參數位置代表某個物件來得好。 Type 1 IoC是Interface injection,使用Type 1 IoC時會要求實作介面,這個介面是為容器所用的,容器知道介面上所規定的方法,它可以呼叫實作介面的物件來完成依賴關係的注入,例如:
public interface IDependencyInjection { public void createDependency(Map dependObjects); } public class BusinessObject implement IDependencyInjection { private Map dependObjects; public void createDependency(Map dependObjects) { this.dependObject = dependObjects; // 在這邊實現與BusinessObject的依賴關係 ...... } public void save() { .... writer.saveToDevice(); } }如果要完成依賴關係注入的物件,必須實現IDependencyInjection介面,並交由容器管理,容器會呼叫被管理物件的createDependency()方法來完成依賴關係的建立。 在上面的例子中,Type 1 IoC要求BusinessObject實現特定的介面,這就使得BusinessObject依賴於容器,如果日後BusinessObject要脫離目前這個容器,就必須修改程式,想想在更複雜的依賴關係中產生更多複雜的介面,組件與容器(框架)的依賴會更加複雜,最後使得組件無法從容器中脫離。 所以Type 1 IoC具有強的侵入性,使用它來實現依賴注入會使得組件相依於容器(框架),降低組件的重用性。 Spring的核心是個IoC容器,您可以用Setter或Constructor的方式來實現您的業務物件,至於物件與物件之間的關係建立,則透過組態設定,讓Spring在執行時期根據組態檔的設定來為您建立物件之間的依賴關係,您不必特地撰寫一些Helper來自行建立這些物件之間的依賴關係,這不僅減少了大量的程式撰寫,也降低了物件之間的耦合程度。
MSSQL 交易層級改為Snapshot層級
SqlServer Cache後的差異
html元件 vs Asp元件onclick事件的不同
<%@ Page Language="C#" AutoEventWireup="true" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<%--JavaScript—%>
<script type="text/javascript">
function ClientSideScript() { alert('ClientSide!'); }
</script>
<%--Inline Code—%>
<script language="CS" runat="server">
protected void ServerSideScript(object sender, EventArgs e) { Response.Write("alert('ServerSide!');"); }
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" id="Button2" runat="server" value="html_button" onserverclick="ServerSideScript" onclick="ClientSideScript();" />
<asp:button id="Button1" runat="server" Text="aspx_button" OnClick="ServerSideScript" OnClientClick="ClientSideScript()" />
</div>
</form>
</body>
</html>
可比較上方asp元件與html元件的差異..
ServerSide:OnClick
ClientSide:OnClientClick
ServerSide:onserverclick
ClientSide:onclick
測試code
在 <code> 及 </code> 之間的東西要先做處理。
- 「&」(AND符號) 換成 '&'
- 「"」(雙引號) 換成 '"'
- 「'」 (單引號) 換成 '''
- 「<」 (小於符號) 換成 '<'
- 「>」 (大於符號) 換成 '>'