SQL SELECT CASE
เราสามารถใช้คำสั่ง CASE WHEN ELSE กำหนดเงื่อนไขให้กับ Field บาง Field ให้มีค่าตามที่ต้องการได้เช่นตัวอย่างด้านล่าง SELECT [OTDay], [OTMonth], [OTYear], [LoginName], [TimeIn], [TimeOut], [Holiday], [HeaderAccount], [FullName], [Department], CASE [Holiday] WHEN '0' THEN 100 WHEN '1' THEN 300…
DevExpress : Get ID from Detail Gridview
เมื่อเราใช้ Master Grid แล้วมี Detail Grid ซ้อนอยู่ในส่วนของ Master Grid เวลาจะเรียกใช้จะต้องทำภายใต้ OnInit protected void ASPxGridView2_Init(object sender, EventArgs e) { GridViewDataTextColumn colTotal = new GridViewDataTextColumn(); colTotal.Caption = "คงเหลือ"; colTotal.FieldName = "Total2"; colTotal.UnboundType…
SqlDataSource ใส่ค่า sql command ในส่วนของ Code behide
<asp:SqlDataSource ID="SqlDataSourceForAutoComplete" runat="server" ConnectionString="<%$ ConnectionStrings:defaultDatabase %>" > </asp:SqlDataSource> SqlDataSource1.SelectCommand = @"SELECT [ID], [Phone], [FirstName], [LastName] FROM (select [ID], [Phone], [FirstName], [LastName], row_number()over(order by t.[LastName]) as [rn] from [Persons] as…
DevExpress : Mask Decimal & Symbol style
ปรับรูปแบบตัวเลขใน textbox ใช้ Mask เป็นตัวจัดการบางทีจะ Error ถ้าเป็นตัวเลขแล้วไม่กำหนดให้ Decimal Symbol ต้องปรับตามภาพด้านล่างในส่วน Properties ของ Mask
