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

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

Read More

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

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

Read More

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],

Read More