2009年12月29日 星期二

SQL語法-取View裡面的SQL語法

例如想读取的VIEW名称 MYVIEW

在ORACLE中:
SELECT TEXT FROM USER_VIEWS WHERE VIEW_NAME ='MYVIEW'

在SQL Server中:
SELECT definition FROM sysobjects a,sys.all_sql_modules b WHERE a.id = b.object_id and name ='MYVIEW'

在SyBase中:
SELECT b.text FROM sysobjects a,syscomments b WHERE a.id = b.id and
 a.name ='MYVIEW'

特别提示:
Oracle中的返回是查询语句部分
SQL Server返回的是 "CREATE VIEW MYVIEW AS " + 查询语句部分  .如果有换行,换行符号也包含在里边

2009年12月28日 星期一

Gridview 自動編號

自動編號
      <%# Container.DataItemIndex + 1 %>
雙向資料聯繫
      Bind("資料欄位")
單向資料聯繫
      Eval("資料欄位")
c# 雙引號表示法  @""""

Textbox背景透明css
background:Transparent;

 當Script遇見UpdatePanel時
   ClientScript.RegisterStartupScript(this.GetType, UniqueID,"alert('hi')",true); 
變身為
  ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "alert('hi')", true);