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

搜尋意見
文章分類-Reiko
[所有文章分類]
  • ASP.NET (7)
  • ASP.NET2.0 (1)
  • ASP.NET4.0 (6)
  • JavaScript (5)
  • jQuery (3)
  • FireFox (1)
  • UW系統設定 (1)
  • SQL (11)
  • SQL 2008 (12)
  • mirror (4)
  • SVN (0)
  • IE (2)
  • IIS (5)
  • IIS6 (1)
  • 閒聊 (0)
  • W3C (0)
  • 作業系統 (1)
  • C# (3)
  • CSS (0)
  • FileServer (0)
  • HTML 5 (0)
  • CKEditor (1)
  • UW.dll (0)
  • Visual Studio (3)
  • Browser (1)
  • SEO (0)
  • Google Apps (1)
  • 網站輔助系統 (0)
  • DNS (5)
  • SMTP (0)
  • 網管 (0)
  • 社群API (0)
  • SSL (3)
  • App_Inventor (0)
  • URLRewrite (1)
  • 開發工具 (1)
  • JSON (1)
  • Excel2007 (0)
  • 試題 (0)
  • LINQ (1)
  • bootstrap (0)
  • Vue (0)
  • IIS7 (0)
  • foodpanda (0)
  • 編碼 (0)
  • 資安 (0)
  • Sourcetree (0)
  • MAUI (0)
  • CMD (0)
  • my sql (0)
所有文章分類
[Reiko的分類]
  • 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)
最新回應
  • dotnet ef dbcontext scaffold
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • dotnet ef dbcontext scaffold
    更新到最新版的 dotnet-ef tooldotnet tool update --global ...more
  • dotnet ef dbcontext scaffold
    還需要這個:Microsoft.EntityFrameworkCore.Design...more
  • dotnet ef dbcontext scaffold
    指定版本:dotnet add package Microsoft.EntityFrameworkC...more
  • SQL 2008 Mirror Setting
    有設定見證伺服器但在Principal掛掉卻不會自動轉到Mirror資料庫在DBC加上: Failo...more
  • SQL 2008 Mirror Setting
    最近更換機房後201重啟很久,造成有設定Mirror的資料庫一直處於復原中狀態,網站無法正常運作(可...more
  • Send Mail By gmail SMTP
    出現錯誤訊息:System.Net.Mail.SmtpException: SMTP 伺服器需要安全...more
  • [SQL]將多筆資料合併為一筆顯示(FOR XML PATH)
    實測發現長度只能到 2034 個字元所以太長的話會被截斷...more
標籤
  • ip[t]
  • [u2]
  • AD
  • 60
  • 488
  • 4669
  • MIME
  • PAY
  • response
  • postgre
  • EN
  • -1140
  • 圖片
  • SQL
  • .net
  • 88.2ZyLw
  • 2625
  • 5040
  • Rf
  • 版本
  • datagrid
  • autopostba
  • 354
  • server
  • 140
  • ?
  • HTML
  • sonarCube
  • 找到的組件資訊清單定
  • 658
  • c
  • .
  • server err
  • 0
  • -6532
  • 12
  • sftp
  • my sql
  • 5275
  • 958
  • 514
  • 892
  • @@26E64
  • 406
  • GN
  • sing
  • 116
  • SMTP,
  • 422
  • 634
頁數 2 / 8 上一頁 下一頁
SQL 遞迴
<範例>
Table: [員工資料表]
欄位: [主管], [員工]

需求是: 當輸入一個員工姓名, 要把該員工下面所有階層的員工都Show出來

SQL語法:
 
WITH [員工資料表new] AS (
--找出 [主管] 為 某人的資料當作 依據
SELECT [主管], [員工]
FROM [員工資料表]
WHERE [主管] = 'XXXX'

UNION ALL

--之後以 上面查出的結果 為依據遞迴查詢
SELECT e.[主管], e.[員工]
FROM [員工資料表] e
INNER JOIN [員工資料表new] ecte ON ecte.[員工] = e.[主管]
)
SELECT *
FROM [員工資料表new]


參考網站: [SQL] 遞迴的寫法
More...
Reiko, 2017/12/18 下午 08:21:51
LINE Pay介接
LINE Pay款流程: 
reserve Page(紅科) 發送 reserve API => 取得 payment URL => 轉址到 payment URL => LINE Pay 檢查USER狀態 => 轉回confirm page(紅科), 發送 confirm API => DOWN.

付款需要程式: 
reserve API, confirm API:

send request JSON and read return JSON:
C#: 
using System.Net;
using System.IO;

public partial class TEST : System.Web.UI.Page
{
    DB.OrderMain oOrderObj = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        //Setting request header
        HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("__APIRootURL__");
        httpWebRequest.ContentType = "application/json; charset=UTF-8";
        httpWebRequest.Method = "POST";
        httpWebRequest.Headers.Add("X-LINE-ChannelId", DB.SysConfig.LINEPay.ChannelId);
        httpWebRequest.Headers.Add("X-LINE-ChannelSecret", DB.SysConfig.LINEPay.SecretKey);

        //加入參數
        using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
        {
            string requestJSON = "{\"productName\": \"" + DB.SysConfig.SYSTEM_NAME + "\"," +
                                "\"productImageUrl\": \"" + DB.SysConfig.URL_Shopping + "images/Logo.jpg\"," +
                                "\"amount\": " + oOrderObj.TotalAmount() + "," +
                                "\"currency\": \"TWD\"," +
                                "\"orderId\": \"" + oOrderObj.DisplayOrderId + "\"," +
                                "\"confirmUrl\": \"" + DB.SysConfig.URL_Shopping + "Handler/LinePay/GotoComfirm.aspx?Id=" + oOrderObj.Id + "\"," +
                                "\"cancelUrl\": \"" + DB.SysConfig.URL_Shopping + "Shopping/OrderComplete.aspx?Id=" + oOrderObj.Id + "\"," +
                                "\"capture\": \"true\"," +
                                "\"confirmUrlType\": \"CLIENT\"}";

            streamWriter.Write(requestJSON);
            streamWriter.Flush();
            streamWriter.Close();
        }

        //取得回覆資訊
        var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
        //解讀回覆資訊
        using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
        {
            var responseJSON = streamReader.ReadToEnd();
            //將 JSON 轉為物件
            GN.LinePay.reserveRes.ReturnJSON oReturnObj = (GN.LinePay.reserveRes.ReturnJSON)Newtonsoft.Json.JsonConvert.DeserializeObject(responseJSON, typeof(GN.LinePay.reserveRes.ReturnJSON));

            if (oReturnObj.returnCode == "0000")
            {
                //成功
            }
            else
            {
                //失敗
                string ErrMsg = "Error Code: " + oReturnObj.returnCode + "\r\n" + oReturnObj.returnMessage;
            }
        }
    }
}


.vb
Imports System.Net
Imports System.IO

Partial Class TEST
    Inherits System.Web.UI.Page

    Dim oOrderObj As DB.OrderMain
    Private Sub Admin_TEST_Load(sender As Object, e As EventArgs) Handles Me.Load
        'Setting request header
        Dim httpWebRequest As HttpWebRequest = WebRequest.Create("__APIRootURL__")
        httpWebRequest.ContentType = "application/json; charset=UTF-8"
        httpWebRequest.Method = "POST"
        httpWebRequest.Headers.Add("X-LINE-ChannelId", DB.SysConfig.LINEPay.ChannelId)
        httpWebRequest.Headers.Add("X-LINE-ChannelSecret", DB.SysConfig.LINEPay.SecretKey)
        '加入參數
        Using streamWriter As New StreamWriter(httpWebRequest.GetRequestStream())
            Dim requestJSON As String = "{""productName"": """ + DB.SysConfig.SYSTEM_NAME + """," +
                                        """productImageUrl"": """ + DB.SysConfig.URL_Shopping + "images/Logo.jpg""," +
                                        """amount"": " + oOrderObj.TotalAmount() + "," +
                                        """currency"": ""TWD""," +
                                        """orderId"": """ + oOrderObj.DisplayOrderId + """," +
                                        """confirmUrl"": """ + DB.SysConfig.URL_Shopping + "Handler/LinePay/GotoComfirm.aspx?Id=" + oOrderObj.Id + """," +
                                        """cancelUrl"": """ + DB.SysConfig.URL_Shopping + "Shopping/OrderComplete.aspx?Id=" + oOrderObj.Id + """," +
                                        """capture"": ""true""," +
                                        """confirmUrlType"": ""CLIENT""}"

            streamWriter.Write(requestJSON)
            streamWriter.Flush()
            streamWriter.Close()
        End Using
        '取得回覆資訊
        Dim httpResponse As HttpWebResponse = httpWebRequest.GetResponse
        '解讀回覆資訊
        Using streamReader As New StreamReader(httpResponse.GetResponseStream())
            Dim responseJSON As String = streamReader.ReadToEnd()
            '將 JSON 轉為物件
            Dim oReturnObj As GN.LinePay.reserveRes.ReturnJSON = Newtonsoft.Json.JsonConvert.DeserializeObject(responseJSON, GetType(GN.LinePay.reserveRes.ReturnJSON))

            Dim ResMsg As String = ""
            If oReturnObj.returnCode = "0000" Then
                '成功

            Else
                '失敗
            End If
        End Using
    End Sub
End Class




工具網站:
JSON 轉物件 http://json2csharp.com/
C# to VB : http://converter.telerik.com/



#專案: 紅科
More...
Reiko, 2017/6/21 下午 07:22:58
Change miror 主體資料庫
手動轉換mirror主體與鏡像資料庫,點"容錯移轉"按鈕,即可變更鏡像為主體資料庫
More...
Reiko, 2016/2/19 下午 01:13:10
HTML 的上標字與下標字
上標文字或符號,英文是 superscript ,下標文字或符號,英文是 subscript ,而在網頁 HTML 中即是 <sup> 與 <sub> 標籤。




參考來源:http://www.phd.com.tw/knowledge/html/text/
More...
Reiko, 2015/7/22 下午 05:46:36
IE11無法套用CKEditor
慧守CKEditor編輯器版本更新(目前版本IE11無法使用),更新至4.4.7後,大部份IE11皆正常,但有台電腦無法正常運作。
該電腦:




原套用方法:
<textarea style="width:675px; height:60px" name="Description" id="Description">#Description#</textarea>
                                            <script type="text/javascript">
                                                CKEDITOR.replace('Description');
                                            </script>


更改為下面方法即可:
​
<textarea style="width:675px; height:60px" name="Description" id="Description">#Description#</textarea>
                                            <script type="text/javascript">
                                                $('#Description').ckeditor();
                                            </script>
More...
Reiko, 2015/6/30 下午 05:13:01
C# 下拉選單AutoPostBack後Button點擊沒反應
改用javascript送出
<asp:Button ID="BtnSubmit" runat="server" Text="修改" OnClick="BtnSubmit_Click" OnClientClick="return formSubmit('true');" />


<script type="text/javascript">
                function formSubmit(val) {
                    if (val== "true")
                    {
                        form1.submit();
                    } else {
                        return false;
                    }
                }
            </script>


相關專案: 光寶
More...
Reiko, 2015/6/29 下午 03:49:57
SQL無法開啟備份裝置,存取被拒
SQL備份出現錯誤訊息:
Cannot open backup device 'D:\xxxxxxx.bak'
Operationg system error 5(存取被拒。)


排除方法:
  1. 不要使用 Network Services 來啟動,改使用別的帳號啟動,這樣以後備份匯出就沒有問題。
     
     
  2. 修改要匯出資料夾的權限,讓 Network Services 有寫入的權限,這樣就可以正常備份了。
     
     

參考:http://rojerchen.blogspot.tw/2013/07/mssql5.html
More...
Reiko, 2015/5/14 下午 02:37:16
關閉 Server 2012 IE ESC
 
 

按F5重新整理,即可看到"關閉"狀態 
 
More...
Reiko, 2015/4/14 上午 09:23:01
如何將 Mydata 的 restoring state 取消

錯誤訊息:
ALTER DATABASE is not permitted while a database in in the Restoring state.

ALTER DATABASE statement failed. (Microsfot SQL, Error 5052).


RESTORE DATABASE [資料庫名稱]
WITH RECOVERY;

 

More...
Reiko, 2015/3/19 下午 04:28:59
Change mirror endpoint port

SELECT * FROM sys.tcp_endpoints

 
ALTER ENDPOINT [Mirroring] AS TCP (listener_port = 5023)


參考:http://www.macaalay.com/2012/10/10/altering-mirroring-endpoints-ports-on-sql-server/
More...
Reiko, 2015/3/19 下午 03:35:35
|< 12345678 >|
頁數 2 / 8 上一頁 下一頁
~ Uwinfo ~