UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • -1290
  • 0KeeTeam
  • -5672
  • 5151
  • Rf
  • win
  • 594
  • en
  • replace
  • ad
  • VS
  • FireFox
  • TPBase
  • dns
  • 9936
  • download21
  • 3154
  • c
  • kmfMu4Pa
  • dddd
  • XHbB5sz4
  • -8926
  • 9347
  • 524
  • -7984
  • sing
  • 8330
  • sca
  • ordermain[
  • 80
  • -2755
  • 192[t]
  • html,
  • 53GELvYP
  • 遠端[t]
  • kerry
  • 老試
  • MVC
  • 光寶
  • d8yl.com
  • jq
  • 258
  • 安裝
  • pg
  • lvcfjvow
  • 版本
  • -5083
  • CSR
  • 專案
  • en21211211
頁數 16 / 39 上一頁 下一頁
搜尋 ti 結果:
UW DB物件 GetAllDataFromBaseTableWithCache 會嚴重影響效能
UW -> DB 物件產生器會產生兩個function
GetAllDataFromBaseTableWithCache(string OrderFields = "_Default", bool IsCopy = true )
以及
Get物件名稱FromCachedDT(string Key)
-----------------------------------------------------------
設計上是希望將所有資料Cache在記憶體,然後前端直接抓出資料,不須到資料庫抓資料
理論上網頁速度應該比較佳,實際上卻發現是效能殺手

原因在於 GetAllDataFromBaseTableWithCache 是抓出整個table的資料放到 Cache
然後又做了一件事,當有人要資料時,會把整個 DataTable 做 Copy() 再 return
也就是說,當DataTable有數千筆資料列時
每叫用一次 "Get物件名稱FromCachedDT(string Key)" 就會把數千筆資料整個複製一次
再從複製出來的DataTable Select 出一列 return
------------------------------------------------------------
解決方法:
Get物件名稱FromCachedDT(string Key)  --> 改成一筆一筆資料做 Cache,這樣 Copy() 只會Copy一筆
實測上,原本頁面要跑1.8秒,調整後可以 0.4 秒就完成
-----------------------------------------------------------
結論:
PG產生器就把 GetAllDataFromBaseTableWithCache 拿掉吧
More...
darren, 2018/5/21 下午 03:17:00
SEO 原則
目標收集 SEO 的 10 個最重要的原則. 10 個就好....

1. 每一頁都要有 title, description. 但不可以有 keyword.

2. 使用 URL Rewrite.

3. 產品說明: https://developers.google.com/search/docs/data-types/product

4. 圖片加上 title 和 alt

5. Description 中, 重點關鍵字要出現兩次.

6. 使用 canonical 集合積分統計統果.
More...
Bike, 2018/5/11 下午 12:06:17
[CSS] z-index 可解決重疊觸發問題




點選開始結帳卻發現觸發後面商品數量的select按鈕
若select z-index=200 則蓋在上面的按鈕則z-index=201
上面的z-index要比下面的z-index大
就可以解決了

 
More...
choco, 2018/4/27 上午 10:50:19
LINQ 用變數方式讀取欄位

        public void TEST(SEPM.SEPMDataContext oDC)
        {
            //一般 LINQ 寫法, 欄位只能寫死, 如:
            var Q = query.OrderBy(r => r.statusId).ToList();

            //若 OrderBy 的欄位不是固定的

            //方法一:條列
            var orderBy = "XXX";
            if (orderBy == "ownerId")
            {
                Q = Q.OrderBy(r => r.ownerId).ToList();
            }
            else if (orderBy == "endDate")
            {
                Q = Q.OrderBy(r => r.endDate).ToList();
            }

            //方法二:
            Q = Q.OrderBy(r => GetPropertyValue(r, orderBy)).ToList();
        }

        private object GetPropertyValue(object obj, string property)
        {
            System.Reflection.PropertyInfo propertyInfo = obj.GetType().GetProperty(property);
            return propertyInfo.GetValue(obj, null);
        }



參考:http://coderemind.blogspot.tw/2013/10/linq.html
More...
Reiko, 2018/4/20 上午 09:14:26
顯示錯誤位置的行數 MVC C# Error Line Number
https://stackoverflow.com/questions/628565/display-lines-number-in-stack-trace-for-net-assembly-in-release-mode/628590#628590

1. Go into the Properties window for the project where you want to see stack trace line numbers.
2. Click on the Build "vertical tab".
3. Select "Release" configuration. Check the DEBUG constant parameter.
4. Uncheck the "Optimize code" parameter to avoid the occasional trace issue with inlined code (this step is not essential).
5. Press the Advanced... button and choose Output -> Debug Info -> pdb-only.
6. Deploy the generated .pdb file with the assembly.

 
 
 
More...
Bike, 2018/4/9 上午 09:40:12
比較程式碼
以前年輕不懂事, 寫了一些很遜的程式碼, 例如:

舊的程式碼:

        public static DataTable DTFromSQL(string Sql, string DBC = null, Int32 timeout = 0)
        {
            SqlDataAdapter DA = new SqlDataAdapter(Sql, GetDBC(DBC));

            DataTable DT = new DataTable();
            try
            {
                DA = new SqlDataAdapter(Sql, DBC);
                if (timeout > 0)
                {
                    DA.SelectCommand.CommandTimeout = timeout;
                }

                DA.Fill(DT);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            finally
            {
                DA.Dispose();
            }

            return DT;
        }


新的程式碼:
        public static DataTable DTFromSQL(string Sql, string DBC = null, Int32 timeout = 30)
        {
            using (var DA = new SqlDataAdapter(Sql, GetDBC(DBC)))
            {
                //不可為 null
                DataTable DT = new DataTable();

                DA.SelectCommand.CommandTimeout = timeout;

                DA.Fill(DT);

                return DT;
            }
        }


可以參考:
https://dotblogs.com.tw/yc421206/archive/2012/01/03/64154.aspx
 
More...
Bike, 2018/4/4 上午 07:56:39
試分析以下兩個 function..
試分析以下兩個 function..

        public static void WriteText1(string FileName, List<string> ltData)
        {
            foreach(string data in ltData)
            {
                System.IO.File.AppendAllText(FileName, data);
            }
        }

        public static void WriteText2(string FileName, List<string> ltData)
        {
            var Res = "";
            foreach (string data in ltData)
            {
                Res += data;
            }

            System.IO.File.WriteAllText(FileName, Res);
        }
More...
Bike, 2018/4/3 上午 09:47:29
global.asax application sequence
https://www.techrepublic.com/article/working-with-the-aspnet-globalasax-file/

Application_BeginRequest
Application_AuthenticateRequest
Application_AuthorizeRequest
Application_ResolveRequestCache
Application_AcquireRequestState
Application_PreRequestHandlerExecute
Application_PreSendRequestHeaders
Application_PreSendRequestContent
<<code is executed>>
Application_PostRequestHandlerExecute
Application_ReleaseRequestState
Application_UpdateRequestCache
Application_EndRequest
More...
Bike, 2018/3/27 下午 07:00:56
ROW_NUMBER 和 Partition (抓出分組中的第一筆資料)
抓出每個 Block_Id 中, End_Date 最小的資料.

語法 A:
With TempBlock as (
Select *, 
ROW_NUMBER() OVER(PARTITION BY B.Block_Id ORDER BY B.End_Date, B.Id) AS rk 
from BlockData B Where IsDelete = 'N' and End_Date >= getDate())
Select * from TempBlock Where rk = 1

語法 B:
Select * from (
Select *, 
ROW_NUMBER() OVER(PARTITION BY B.Block_Id ORDER BY B.End_Date, B.Id) AS rk 
from BlockData B Where IsDelete = 'N' and End_Date >= getDate()) TempBlock 
Where rk = 1
More...
Bike, 2017/12/27 下午 04:25:20
SQL 變更欄位不允許儲存
修改欄位設定時,出現需要刪除資料表(drop table)再建立資料表(create table)才能修改時,
於 [工具] > [選項] > [設計工具]
清除防止儲存需要重新建立資料表的變更] 核取方塊,即可。
如下圖


參考網址:https://support.microsoft.com/zh-tw/help/956176/error-message-when-you-try-to-save-a-table-in-sql-server-saving-change
 
More...
choco, 2017/12/27 下午 01:49:41
|< …78910111213141516… >|
頁數 16 / 39 上一頁 下一頁
~ Uwinfo ~