วันอาทิตย์ที่ 19 เมษายน พ.ศ. 2558

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.



วิธีแก้ไข
folder: %windir%\Microsoft.Net\Framework\v2.0.50.27\CONFIG\web.config
************************************
<system .web="">
        <authorization>
            <allow users="*" verbs="GET,POST">
        </allow></authorization>
</system>
************************************
แก้ไขเป็น
*********************************
<system .web="">
        <authorization>
            <allow users="*" verbs="">
        </allow></authorization>
</system>
*********************************

วันอังคารที่ 24 มีนาคม พ.ศ. 2558

Linq OrderBy Extension

ในการพัฒนาโปรแกรม ด้วย ASP.net ต้องมีการQuery ข้อมูลมาแสดงในGridView ซึ่งต้องมีส่วนของการ Sort Data แน่นอน และถ้าเราใช้ LinQ ละ? ผมจึงนำ Extension Method ใน LinQ นำมาฝาก
รูปแบบการเรียกใช้งานทำได้ดังนี้


list.OrderBy("SomeProperty");
list.OrderBy("SomeProperty DESC");
list.OrderBy("SomeProperty DESC, SomeOtherProperty");
list.OrderBy("SomeSubObject.SomeProperty ASC, SomeOtherProperty DESC");

 ที่มา
Dynamic SQL-like Linq OrderBy Extension
http://aonnull.blogspot.com/2010/08/dynamic-sql-like-linq-orderby-extension.html


C#.net Convert To VB.net By :http://converter.telerik.com/


View Code