2014年10月16日 星期四

【Jquery】jquery.validate.js 取消驗證 Cancel 按鈕

驗證欄位工具

Jquery 外掛:

jquery.validate.js

button Control
屬性  新增一個:UseSubmitBehavior="True"

就可以了不用驗證

用徒在於:

送出、取消

取消 按鈕上使用

2014年10月9日 星期四

【MS SQL 資料庫 trigger 】 查詢 觸發事件 資料


 SCHEMA_NAME(tb.schema_id) N'結構描述', OBJECT_NAME(t.parent_id) N'資料表', t.name N'觸發程序名稱', parent_class_desc N'觸發程序父類別的描述',
 t.type_desc N'物件類型的描述',  tEV.type_desc '引發觸發程序的每個事件', is_instead_of_trigger N'是否為 INSTEAD OF 觸發程序'
FROM sys.triggers t INNER JOIN sys.trigger_events tEV ON t.object_id = tEV.object_id
 INNER JOIN sys.tables tb ON t.parent_id = tb.object_id

德瑞克
轉載:http://sharedderrick.blogspot.tw/2013/08/dml-trigger.html

2014年10月7日 星期二

【JAVASCRIPT,JQUERY】依據不同的瀏覽器,取得 XMLHttpRequest 物件

// 依據不同的瀏覽器,取得 XMLHttpRequest 物件
function createAJAX() {

if (window.ActiveXObject) {
try{
//alert('msx');
return new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
//alert(e.description);
try {
//alert('micro');
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
//alert(e.description);
//alert('null0');
return null;
}
}
//alert('active');
} else if (window.XMLHttpRequest) {
//alert('xmlhttp');
return new XMLHttpRequest();
} else {
//alert('null');
return null;
}
}

2014年9月26日 星期五

【ASP.NET】透過 JQUERY JSON AJAX 呼叫 asp.net WEB service 問題(POST 跟 GET )

透過  JQUERY  JSON  AJAX  呼叫  Asp.net WEB service 問題(POST 跟 GET )

但發佈上去後,別人電腦透過網址連線,卻發生 問題

在chrome 錯誤訊息說什麼找不到 IIS 500 訊息

但在本機卻都沒問題

jquery 程式如下:

    function callHellWord() {
        $.ajax({
            type: "POST",
            url: "http://XXXX.XXXX.XXXX.tw/service/XXXXXX.asmx/ApplyWifi",
            contentType: "application/json; charset=utf-8",
            dataType: "text",
            success: function(data) {
    alert('ok');
            }
        });
    }

一、原來問題出在 web.config 上

二、因為路徑問題,所以URL 要完整路徑
只要加上 允許 部份就可以了,預設是關閉
   
WEB.CONFIG 官方參考網址: http://msdn.microsoft.com/zh-tw/library/aa719747(v=vs.71).aspx

2014年9月24日 星期三

【知識分享】Word 2010 A3 列印 轉 A4 紙張

【知識分享】Word 2010 A3 列印 轉換  A4 紙張

當內容版型是A3

如果縮小 成 A4 紙張

功能如下方:


2014年9月21日 星期日

【VS 2010 】vs2010 工具箱 標準項目 不見

【VS 2010 】 Microsoft Visual Studio 2010

vs2010 工具箱 內 標準 項目 不見

【為何不見】
軟微更新動到 一些設定


【如何恢復】
你的 vs2010 的捷徑
 右鍵\相容性
把相容性 勾勾取消掉


就搞定了




2014年9月11日 星期四

【生活知識】 從 1加到99 是多少? 教學

YHAOO 神人 (魷魚絲) 教學

運用 梯形公式
(上底+下底)×高 ÷ 2
= (1+99)×99     ÷2
= 100 ×99     ÷2
= 9900     ÷2
= 4950


這個公式還蠻好記的

2014年8月28日 星期四

【ASP.NET】時間 GET TIME

// create date time 2008-03-09 16:05:07.123
DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);

String.Format("{0:y yy yyy yyyy}", dt);  // "8 08 008 2008"   year
String.Format("{0:M MM MMM MMMM}", dt);  // "3 03 Mar March"  month
String.Format("{0:d dd ddd dddd}", dt);  // "9 09 Sun Sunday" day
String.Format("{0:h hh H HH}",     dt);  // "4 04 16 16"      hour 12/24
String.Format("{0:m mm}",          dt);  // "5 05"            minute
String.Format("{0:s ss}",          dt);  // "7 07"            second
String.Format("{0:f ff fff ffff}", dt);  // "1 12 123 1230"   sec.fraction
String.Format("{0:F FF FFF FFFF}", dt);  // "1 12 123 123"    without zeroes
String.Format("{0:t tt}",          dt);  // "P PM"            A.M. or P.M.
String.Format("{0:z zz zzz}",      dt);  // "-6 -06 -06:00"   time zone


// month/day numbers without/with leading zeroes
String.Format("{0:M/d/yyyy}", dt);            // "3/9/2008"
String.Format("{0:MM/dd/yyyy}", dt);          // "03/09/2008"

// day/month names
String.Format("{0:ddd, MMM d, yyyy}", dt);    // "Sun, Mar 9, 2008"
String.Format("{0:dddd, MMMM d, yyyy}", dt);  // "Sunday, March 9, 2008"

// two/four digit year
String.Format("{0:MM/dd/yy}", dt);            // "03/09/08"
String.Format("{0:MM/dd/yyyy}", dt);          // "03/09/2008"

2014年8月21日 星期四

【財經】術語

半導體找台積電
面板找友達
IC設計是聯發科
智慧手機就是宏達電

2014年7月10日 星期四

【asp.net jquery json】解決出現 is not allowed by Access-Control-Allow-Origin

我的做法是:
asp.net 頁面上使用 jquery json 格式
到跨ip 回傳到 ashx 的頁面讀資料,
導致

Chrome 頁面上出現錯誤訊息

allow xxx 鬼的

只要 在ashx 那隻上面 加以下這樣就可以了

HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");

另外記得json 回傳的conten-type 要定義相符,不然資料會有問題

【ASP.NET】編譯時 本機找不到OpenXml 檔案 DocumentFormat.OpenXml 2.5.0

DocumentFormat.OpenXml 2.5.0

編譯時執行時找不到 OpenXML



利用NeuGet 管理介面
執行以下指令

Install-Package DocumentFormat.OpenXml


2014年7月3日 星期四

【ASP NET IIS 教學】參數 設定 說明 maxRequestLength maxQueryStringLength maxUrlLength

有些是NET 4.0 Web.config 才有的參數

檔案大小:
maxRequestLength="81920"

參數長度:
maxQueryStringLength="20480"

連結長度:
maxUrlLength="20480"

附上iis 參考網址:
http://support.microsoft.com/kb/820129

相關網址說明:
http://maxtellyou.blogspot.tw/2012/06/iis6-url-bad-request-request-header-too.html

2014年7月1日 星期二

【SQL ASP.NET】geography STGeomFromText POINT SqlParameter 跟 SQL DECLARE 參數設定

Asp.net 的 SqlParameter 參數如下:

String strSQL = @"
                                DECLARE @g geography;
                                SET @g = geography::STGeomFromText('POINT (' + @x + ' ' + @y + ')', 4326);"

List list = new List();

            if (!string.IsNullOrEmpty(x))
            {
                SqlParameter item = new SqlParameter("x", SqlDbType.NVarChar);
                item.Value = x;
                list.Add(item);
            }

            if (!string.IsNullOrEmpty(y))
            {
                SqlParameter item = new SqlParameter("y", SqlDbType.NVarChar);
                item.Value = y;
                list.Add(item);
            }


SQL 組法如下:
DECLARE @g geography;
DECLARE @x nvarchar = '120.73261855400006';
DECLARE @y nvarchar ='23.9832863352';

SET @g = geography::STGeomFromText('POINT (' + @x + ' ' + @y + ')', 4326);

【ASP.NET】SqlParameter 動態組法 AND like 使用方法

List list = new List(); 

list.Add(new SqlParameter("@Param1", "1"));
list.Add(new SqlParameter("@Param2", "2"));
list.Add(new SqlParameter("@Param3", "3"));
list.Add(new SqlParameter("@Param4", "4"));
list.Add(new SqlParameter("@ParamLike","%test%"));

SqlParameter[] param = list.ToArray();

2014年6月11日 星期三

【Jquery】外掛元件 ( datatables ) 分頁 資料源:HTML JAJX JSON

JQUERY  外掛元件名稱:datatables

JAJX 及JSON  或直接 HTML TABLE 格式

功能:分頁、快速搜尋功能

網址:http://www.datatables.net/examples/data_sources/ajax.html


2014年6月5日 星期四

【IIS】Web KML 及 KML MIME type 問題無法下載,設定教學

在 iis 上 MIME

檔案:kml
MIME type
新增:application/vnd.google-earth.kml+xml

檔案:kmz
MIME type
新增:application/vnd.google-earth.kmz

2014年5月4日 星期日

【ASP.NET MSSQL】int16 int 32 int 64 Convert 數字 smallint int bigint 型態 對照 表

ASP.NET C#

Int 16 -- (-32,768 to +32,767)

Int 32 -- (-2,147,483,648 to +2,147,483,647)

Int 64 -- (-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807)
 
MS SQL 欄位:

smallint -2^15 (-32,768) 到 2^15-1 (32,767) 2 位元組

int -2^31 (-2,147,483,648) 到 2^31-1 (2,147,483,647) 4 個位元組

bigint -2^63 (-9,223,372,036,854,775,808) 到 2^63-1 (9,223,372,036,854,775,807) 8 位元組

tinyint 0 到 255 1 位元組

PS.以上列出在程式需要用到的數字,「對應」,MSSQL 數字欄位

2014年4月7日 星期一

【Excel】 長度 數字 補零 ,數字前面沒有零

【 Excel 教學 】 長度 數字 補零 ,數字前面沒有零
公式
=IF(LEN(C1) <> 8,RIGHT("00000000"&C1,8),C1)
=RIGHT("00000000"&C1,8)
=TEXT(C1,"00000000")

【生活知識】VLC media player外掛字幕顯示亂碼

VLC media player外掛字幕顯示亂碼

轉載:http://blog.xuite.net/yh96301/blog/181177701-VLC+media+player%E5%A4%96%E6%8E%9B%E5%AD%97%E5%B9%95%E9%A1%AF%E7%A4%BA%E4%BA%82%E7%A2%BC

2014年1月31日 星期五

【吉他譜】半月彎

1=bE  2/4   D調 變調夾夾一品

      D                   #Fm
昨夜的南風輕輕 新月彎彎
B                               Em
有人俳徊 深夜愁緒驅不散
Em/#D     Em/D
似醉似醒 那午夜的夢
G                A
漸漸離我走遠
      D             #Fm       
今夜的寒星點點 浮去淡淡
  B                      Em        Em/#D
有人追尋往日回憶悲歡 是苦是甜
    G        A           Bm
那失去的愛一去不返
A     D                 G   
總是忘不了她深情款款
G           A         #Fm
為她編織密密的情網
Bm    A      G          A        D
千縷萬縷的情絲 割也割不斷
    D              G
總是忘不了她深情款款
G          A          #Fm
為她編織密密的情網
Bm   A     G            A        D
千縷萬縷的情絲 割也割不斷
D                 G
忘不了她深情款款
G            A        #Fm
為她編織密密的情網
Bm     A     G           A       D
千縷萬縷的情絲 割也割不斷
D  G  G  A  #Fm  Bm  A  G   A  
多次反復結束。

啦啦啦啦啦
Em/#D
按好食指四弦一品,中指五弦二品;    Em/D中指五弦二品;

2014年1月29日 星期三

【電影】薩凡納 心得

語言:美國
片名:薩凡納
出片:2013
類型:愛情
心得:原來前後的劇情,越來越深,不論是在朋友上或是在愛情上,讓我看到最後,我都要躲起來偷哭,好感人。