2016年7月20日 星期三
[MSSQL] 資料庫主體在資料庫中擁有 結構描述 且無法卸除 (Microsoft SQL Server, 錯誤: 15138)
參考:http://dog0416.blogspot.tw/2015/04/databasemssql-microsoft-sql-server-15138.html
在Microsoft SQL Server Managment Studio ,展開安全性 -> 使用者,滑鼠右鍵點選使
用者,選擇刪除。
出現刪除視窗後,點選確定,出現下列錯誤訊息。
錯誤訊息:
資料庫主體在資料庫中擁有 結構描述 且無法卸除 (Microsoft SQL Server, 錯誤: 15138)
Error message:
The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138).
我們使用下列指令,將所有在此資料庫的結構描述指派給dbo,該資料庫使用者物件即可移除。
ALTER AUTHORIZATION ON SCHEMA::[無法刪除的使用者名稱] TO [dbo]
2016年4月7日 星期四
[c#] (413) Request Entity Too Large
轉自:http://karatejb.blogspot.tw/2015/04/troubleshooting-wcf-error-413-request.html
使用wcf服務時出現以下錯誤
(413) Request Entity Too Large
原來是WCF預設單筆Message size 為65KB, 避免DOS攻擊。
當超過此上限時,便會引發此錯誤。
這時候需再client端和wcf服務端的config加上以下設定
WCF的Config檔
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="32"
maxArrayLength="2147483647"
maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
|
Client的Config檔
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMonitorService"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"receiveTimeout="00:30:00" sendTimeout="00:30:00"/>
</basicHttpBinding>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_IMonitorService">
<security mode="None" />
</binding>
</netNamedPipeBinding>
</bindings>
</system.serviceModel>
</configuration>
|
2016年3月22日 星期二
[C#] NLog 建置筆記
/// <summary>
/// NLog 紀錄
/// </summary>
public static NLog.Logger NLogger = NLog.LogManager.GetCurrentClassLogger();
* 抓取Session的值
參考 https://github.com/NLog/NLog/wiki/AspNetSession-layout-renderer
程式:
Session["user"] = new UserInfo { Name= "johnDoe", Id = 100};
nlog config設定 :
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="file.txt" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logfile" layout="${aspnet-session:Variable=User.Name:EvaluateAsNestedProperties=true}/>
</rules>
</nlog>
發生【LayoutRenderer cannot be found: 'aspnet-request'】的錯誤時,
需安裝 NLog.Extended.dll 可擴增功能
http://kevintsengtw.blogspot.tw/2011/10/nlog-advanced-net-logging-3.html
Session格式範例
http://nlog-project.org/documentation/v2.0.1/html/T_NLog_LayoutRenderers_AspNetSessionValueLayoutRenderer.htm
You can set the value of an ASP.NET Session variable by using the following code:
C#
HttpContext.Current.Session["myvariable"] = 123;
HttpContext.Current.Session["stringvariable"] = "aaa BBB";
HttpContext.Current.Session["anothervariable"] = DateTime.Now;
Example usage of ${aspnet-session}:
${aspnet-session:variable=myvariable} - produces "123"
${aspnet-session:variable=anothervariable} - produces "01/01/2006 00:00:00"
${aspnet-session:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00"
${aspnet-session:variable=myvariable:padding=5} - produces " 123"
${aspnet-session:variable=myvariable:padding=-5} - produces "123 "
${aspnet-session:variable=stringvariable:upperCase=true} - produces "AAA BBB"
常用的:
${time} 時間
${asp-session:variable=String} Session
${aspnet-request:cookie=String:serverVariable=String:queryString=Strin:item=String:form=String}
Cookie_ queryString
${basedir} 根目錄
${date} 日期+時間
${level} log等級
${newline} 換行
${shortdate} yyyy-MM-dd 日期
請參考 https://github.com/nlog/NLog/wiki/Layout%20Renderers
-------------------------------------
NLog config設定的變數宣告方式:
${APName}_${mdc:item=DateName}
程式碼:
//以時間來命名 NLog 檔名,需在NLog.config 宣告 ${mdc:item=DateName} 變數來使用
NLog.MappedDiagnosticsContext.Set("DateName", DateTime.Now.ToString("HH-mm-ss"));
2016年1月10日 星期日
2015年12月7日 星期一
Ubuntu 好用軟體
Author: Mango
|
at:凌晨3:28
|
Category :
ubuntu
|
在這邊做個紀錄
中文輸入法 gcin
桌面小工具 Screenlet
遠端桌面 Remmina
截圖 Shutter
小畫家 KolourPaint
磁碟分割工具 GParted
系統清道夫+調校 ubuntu tweak
螢幕放大Compiz Config
2015年12月4日 星期五
[HTML] html版本寫法差異-[html5&html 4.01]
Author: Mango
|
at:清晨6:09
|
Category :
HTML5
|
html版本寫法差異-[html5&html 4.01]
from: http://goliimage.pixnet.net/blog/post/37688466-html-%E5%9F%BA%E6%9C%AC%E8%AA%AA%E6%98%8E%EF%BC%8801%EF%BC%89-html%E7%89%88%E6%9C%AC%E5%AF%AB%E6%B3%95%E5%B7%AE%E7%95%B0-%5Bhtml5%26html
這些宣告是必須要寫的
from: http://goliimage.pixnet.net/blog/post/37688466-html-%E5%9F%BA%E6%9C%AC%E8%AA%AA%E6%98%8E%EF%BC%8801%EF%BC%89-html%E7%89%88%E6%9C%AC%E5%AF%AB%E6%B3%95%E5%B7%AE%E7%95%B0-%5Bhtml5%26html
這些宣告是必須要寫的
XHTML格式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/> <title>魚與橙的結合</title> </head> <body> </body> </html>
Html 4.01 格式
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"> <title>魚與橙的結合</title> </head> <body> </body> </html>
HTML 5 格式
<!doctype html> <html> <head> <metacharset="utf-8"> <title>魚與橙的結合</title> </head> <body> </body> </html>
以上,可選擇其一複制,當作每個網頁的開頭,其差別在於抬頭的宣告,其實也是告訴瀏覽器說,你的文件是那一種文件檔案。
XHML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML5
<!doctype html>
2015年11月17日 星期二
[C#] 善用DEBUG模式
善用DEBUG狀態下才執行的程式碼來做開發偵錯
在Web.config裡頭定義
<compilation debug="true" targetFramework="4.5" />
在程式碼裡面用
#if DEBUG
#endif
或是
if (HttpContext.Current.IsDebuggingEnabled)
{
}
from:http://blog.miniasp.com/post/2009/09/16/How-to-utilize-Debug-mode-to-develop-aspnet-and-other-net-applications.aspx
http://www.dotnetperls.com/isdebuggingenabled
2015年11月4日 星期三
[ubuntu] CPU調頻
Author: Mango
|
at:凌晨4:10
|
Category :
ubuntu
|
以root開啟該設定檔
/etc/cpufreqd.conf
尋找以下內容,調整maxfreq後重開機
[Profile]
name=Performance High
minfreq=50%
maxfreq=80%
policy=performance
#exec_post=echo 8 > /proc/acpi/sony/brightness
[/Profile]
參考
http://ashotw.blogspot.tw/2008/06/cpufrequtils.html
http://ubuntuforums.org/showthread.php?t=764446
http://ashotw.blogspot.tw/2008/06/cpufrequtils.html
http://askubuntu.com/questions/149271/how-to-change-default-scaling-governor-back-to-ondemand
2015年10月29日 星期四
[ubuntu] widght
Author: Mango
|
at:清晨5:10
|
Category :
ubuntu
|
http://icewalkerz.blogspot.tw/2009/09/installing-wallpaper-clock-in-ubuntu.html
http://www.noobslab.com/2013/09/desktop-screenlets-for-ubuntulinux.html
請使用終端機
下這兩條
sudo apt-get install screenlets
sudo apt-get install screenlets-pack-all
這兩條下好後~
附屬應用程式會多了screenlets
開了後會常駐左上角工具列
可以拿它開許多widght
2015年10月27日 星期二
訂閱:
文章 (Atom)














