Category: C#

การเรียกใช้ Control object ของ Masterpage ใน Class

การเรียกใช้ Control object ของ MasterPage ใน Class เช่นตัวอย่างการทำ Popup Status ในหน้า Master Page และทำการเรียกใช้งานผ่าน Class โดยจะต้องอ้างอิงถึง Control ในหน้า MasterPage ด้วย   1. เริ่มจากวาง Control object ลงใน MasterPage ในส่วนของ <form></form> <dx:ASPxPopupControl…

Send E-mail

ตัวอย่าง Code ASP.NET (C#) สำหรับส่ง E-mail protected void Page_Load(object sender, EventArgs e) { SendMail("ทดสอบส่ง E-mail จ้า"); }   public static bool SendMail(string gMailAccount, string password, string to, string subject, string…

แก้ไขปัญหาเวลาใช้ GridView เมื่อมี Edit หรือ New โดยใช้การ Map ด้วย Data Source

แก้ไขปัญหาเวลาใช้ GridView เมื่อมี Edit หรือ New โดยใช้การ Map ด้วย Data Source  สำหรับบาง Field ทำให้ ปัญหาคือมันจะไม่แสดงค่า Text จะแสดงเป็นค่า Value ต้องไปปรับในส่วนของ Column ให้มี Properties Type ตรงกับ Database

การสร้าง Store Procedure ใน MS Sql Server และเขียนโค้ดใช้งานด้วย ASP.NET C#

วิธีการทำเริ่มจากฝั่ง Database จะต้องสร้าง Database และ Table ขึ้นมา หลังจากนั้นให้เปิดหน้า Query Windows ขึ้นมาเพื่อเขียนคำสั่งสร้าง Store Procedure และกำหนด Parameter กับเงื่อนไขที่จะให้ Store Procedure ทำงาน -- สร้าง Store Procedure ใช้ชื่อว่า dbo.TEST_STORE_INSERT CREATE PROCEDURE dbo.TEST_STORE_INSERT( --กำหนด Parameter…