Read txt file

  • ASP.NET C# วิธีเชื่อม Table 2ตัวใน 1 dataset

    ดาต้าเซตเป็นเหมือนฐานข้อมูลเล์กๆที่จะพักเก็บ ข้อมูลชุดหนึ่งจาก ตัว Database ดังนั้นมันจึงควรสนับสนุนสิ่งสำคัญอย่างหนึ่งของฐานข้อมูล นั่นคือการเชื่อมความสัมพันธ์หรือ relationship ซึ่งก็คือการนำตารางหนึ่งมาผูกกับอีกตารางหนึ่งนั่นเอง โค้ดสำหรับเชื่อมสองเทเบิ้ลภายในหนึ่งดาต้าเซตในภาษา C# เป็นอย่างนี้ System.Data.DataColumn oParentColumn;System.Data.DataColumn oChildColumn;oParentColumn = oDS.Tables["Customers"].Columns["CustomerID"];oChildColumn = oDS.Tables["Orders"].Columns["CustomerID"];System.Data.DataRelation oRelation =…

    Read More »
  • ASP.NET C# วิธีอ่าน Text File

    เมื่อ เขียนโปรแกรมบ่อยครั้งที่เราต้องการอ่านแฟ้มที่เก็บตัวอักษรล้วนๆ หรือ text file เพื่ออ่านข้อมูลบางอย่างที่มีขนาดเล็กและทำงานได้รวดเร็ว โค้ดต่อไปนี้อ่านไฟล์ชื่อ Data.txt ซึ่งอยู่ที่รูทไดเรคทอรีของฮาร์ดดิสก์ (โฟลเดอร์ c:) หัวใจของการทำงานคือการเรียกใช้ไทป์ StreamReader ของ .Net public class FileClass{ public static…

    Read More »
Back to top button
Game & Mobile Development AR VR XR
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Adblock Detected

เราตรวจพบว่าคุณใช้ Adblock บนบราวเซอร์ของคุณ,กรุณาปิดระบบ Adblock ก่อนเข้าอ่าน Content ของเรานะครับ, ถือว่าช่วยเหลือกัน