The MySQL server has gone away (error 2006) has two main causes and solutions:

  • Server timed out and closed the connection. To fix, check that wait_timeout mysql variable in your my.cnf configuration file is large enough, eg wait_timeout = 28800
  • You may also need to increase the innodb_log_file_size mysql variable in your my.cnf configuration to for example innodb_log_file_size = 128MB or higher.
  • Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. To fix, you can increase the maximal packet size limit max_allowed_packet in my.cnf file, eg. set max_allowed_packet = 128M, then restart your MySQL server: sudo /etc/init.d/mysql restart

Once you’ve made these changes, and restarted your MySQL or MariaDB server, the issue should be fixed and no more error triggered. If not, try increase the 128M values to 256M for example. In websites with a lot of traffic and data, you might even need to increase the value to 1024M.

If the above changes do not resolve the issue and if you are using MYSQLI adapter in Matomo, try switching to adapter = PDO\MYSQL in your config/config.ini.php file.

SQL data types เป็นการกำหนดชนิดของข้อมูลในตารางว่าเป็นข้อมูลแบบใด เช่น ข้อมูลตัวเลข, ตัวอักษร, วันเวลา หรือ แบบไม่มีโครงสร้าง ซึ่งสิ่งเหล่านี้จำเป็นตั้งแต่เราเริ่มสร้าง database table เพื่อให้ข้อมูลที่เราจะใส่ลงสู่ table มีความถูกต้องตามที่วางเอาไว้ อีกทั้งยังช่วยให้ฐานข้อมูลหรือ database ของเราทำงานได้ง่ายขึ้นในการจัดเก็บ และการทำดรรชนี (index) ได้เหมาะสมกับข้อมูลที่เราจะใช้งาน โดย data types บน database มีด้วยกันหลายชนิด ขึ้นอยู่กับชนิดของฐานข้อมูล หรือ database ที่เราใช้งาน

Read More

The error “server did not register with DCOM within the required timeout” is signaling that one or more DCOM (Distributed Component Object Model) software is failing to register itself in a reasonable period of time.

A DCOM software needs to register itself as a server of sorts so that other programs or machines can call on its functionality remotely. If it fails to register or if it doesn’t do it within the predetermined time frame, the “server did not register with DCOM within the required timeout” will be displayed in the Event Viewer.

What is DCOM (Distributed Component Object Model)

Read More

การติดต่อสื่อสารภายในเครือข่ายอินเตอร์เน็ต จะต้องมี IP Address สำหรับการส่งข้อมูลเพื่อติดต่อถึงกัน โดยตามปกติแล้ว IP Address จะมีการแบ่งออกเป็น 2 ส่วน คือ ส่วนที่บ่งบอกว่าเป็นหมายเลขเครือข่าย และหมายเลขเครื่องคอมพิวเตอร์ ซึ่งค่าของ IP Address จะมีการกำหนดค่าของ IP Address เป็นไบต์ (Byte) และกำหนดค่าด้วยเลขฐานสิบ ตัวอย่างเช่น IP Address 202.28.8.1 เป็นต้น

Read More

? วิธีใช้งาน ?

เปลี่ยนเพลง: แตะหูฟังข้างซ้าย2ครั้งเพื่อเล่นเพลงก่อนหน้า
รับ/วางสาย: แตะหูฟังข้างซ้าย1ครั้ง
เรียกใช้งาน Siri: กดค้างหูฟังข้างซ้าย1วิ
เล่น/หยุดเพลง:แตะหูฟังข้างซ้าย1ครั้ง
ปรับเสียง: แตะหูฟังข้างซ้าย3ครั้ง
เปิด/ปิดเครื่อง: กดค้างหูฟัง5วิ

Read More

จากหัวข้อก็คงแปลกใจว่าทำไมต้องจัดการ Layout ในเมื่อ Textbox ที่เราวางไว้ สามารถ View Contract บนเว็บได้ปกติ

ในกรณีที่ Textbox มีมากและซับซ้อนเกินไป เมื่อ Export Word/PDF ออกมาแล้ว อาจเกิดปัญหา Layout เพี้ยนได้

ก่อนอื่นเลย เรามาเริ่มเปิด Control สำหรับ Export RDLC เป็น Word/PDF กัน

  • จากที่เคยเกริ่นไป ในการเขียน Controller และ View เพื่อ View Contract ที่เราจากมาแล้ว

บาง Report หรือแบบฟอร์ม ต้องการเงื่อนไข Dynamic สำหรับออกแบบฟอร์มมาให้ตรงตามสถานการณ์นั้นๆ

กรณีนี้จะพูดถึงกรณีที่ต้องการจะซ่อน Textbox ที่มีข้อความอยู่ ไม่ให้แสดงในแบบฟอร์ม

  • วิธีการเขียน Report แบบมีเงื่อนไขการซ่อน เมื่อมีเงื่อนไข เช่นมีแบบฟอร์มใบสมัครที่ให้กรอกชื่อข้อมูลส่วนตัว ดังนี้

เริ่มต้นสร้าง RDLC พื้นฐานด้วย Extension ของ Visual Studio C#

1.ขั้นตอน Install extension ให้เรียบร้อย เริ่มต้นด้วย เลือก Menu Extensions > Manage Extensions ค้นหาคำว่า rdlc แล้วเลือก Install Microsoft RDLC Report Designer

Read More

การรับค่า Indentity จากข้อมูลล่าสุดที่เพิ่มขึ้น หลังจากที่ใช้คำสั่ง INSERT เราสามารถส่งค่าที่เป็นเลขล่าสุดออกมาจาก store procedure ได้หลายวิธีดังนี้

  • SELECT @@IDENTITY หรือ
  • SELECT IDENT_CURRENT(‘ชื่อตาราง’) หรือ
  • SELECT SCOPE_IDENTITY()

Read More