24-03-24, 10:28 PM
مرفق مشروع لتنفيذ ذلك
ولاكن استبدل ال مسافات بين ال تاريخ و مواعيد الصلاه ب -
انشاء DataTable
قرائة الملف تحزين كل بيان في مكان منفصل
ملئ ال جدول من ملف ال تكست
ولاكن استبدل ال مسافات بين ال تاريخ و مواعيد الصلاه ب -
انشاء DataTable
كود :
Dim thedatatable As New DataTable
thedatatable.Columns.Add("Date")
thedatatable.Columns.Add("s1")
thedatatable.Columns.Add("s2")
thedatatable.Columns.Add("s3")
thedatatable.Columns.Add("s4")
thedatatable.Columns.Add("s5")
thedatatable.Columns.Add("s6")قرائة الملف تحزين كل بيان في مكان منفصل
كود :
Dim FileName As String = System.IO.Path.Combine(Application.StartupPath, "altoki939.txt")
For Each line As String In System.IO.File.ReadLines(FileName)
Dim values() As String = line.Split("-".ToCharArray)ملئ ال جدول من ملف ال تكست
كود :
Dim newrow As DataRow = thedatatable.NewRow
newrow("Date") = values(0) + "/" + values(1) + "/" + Now().ToString("yyyy")
newrow("s1") = values(2)
newrow("s2") = values(3)
newrow("s3") = values(4)
newrow("s4") = values(5)
newrow("s5") = values(6)
newrow("s6") = values(7)
thedatatable.Rows.Add(newrow)
Next
DataGridView1.DataSource = thedatatable