 |
|
ขอโค้ด Back Up ข้อมูลหน่อยนะค่ะท่านผู้รู้ทั้งหลายกำลังทำโปรเจคจบค่ะ |
|
 |
|
|
 |
 |
|
ถ้า MS Access มันน่าจะทำได้แค่ Copy ตัว Database ไปไว้อีกที่ครับ
|
 |
 |
 |
 |
Date :
2013-11-04 16:04:05 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ค่ะแต่อาจารย์อยากให้มีวันที่ แล้วก็วีธีการรีสโตด้วยค่ะ
|
 |
 |
 |
 |
Date :
2013-11-05 11:13:38 |
By :
สมองน้อย |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าแบบนั้นคงจะต้อง Generate เป็นพวก Text File ไว้ครับ แล้วเขียน Script มา Import ลงใน Table (ในกรณีที่ทำการ Restore ครับ)
|
 |
 |
 |
 |
Date :
2013-11-05 11:16:49 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โค้ดยังงัยบ้างค่ะ แนะนำด้วยนะค่ะ
|
 |
 |
 |
 |
Date :
2013-11-05 11:39:34 |
By :
สมองน้อย |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองไปดูพวกบทความการ Export เป็น Text file หรือ CSV ครับ หลักการเดียวกัน
|
 |
 |
 |
 |
Date :
2013-11-05 11:41:25 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดึงข้อมูลมาใส่ datatable แล้วเอา datatable เขียนเป็น xml ก็ได้
จะได้ไม่ต้องเขียนเยอะ
|
 |
 |
 |
 |
Date :
2013-11-05 12:49:49 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (C#)
public static void WriteDataToFile(DataTable submittedDataTable, string submittedFilePath)
{
int i = 0;
StreamWriter sw = null;
sw = new StreamWriter(submittedFilePath, false);
for (i = 0; i < submittedDataTable.Columns.Count - 1; i++)
{
sw.Write(submittedDataTable.Columns[i].ColumnName + ";");
}
sw.Write(submittedDataTable.Columns[i].ColumnName);
sw.WriteLine();
foreach (DataRow row in submittedDataTable.Rows)
{
object[] array = row.ItemArray;
for (i = 0; i < array.Length - 1; i++)
{
sw.Write(array[i].ToString() + ";");
}
sw.Write(array[i].ToString());
sw.WriteLine();
}
sw.Close();
}
WriteDataToFile(dt,"/path/thaicreate.txt");
|
 |
 |
 |
 |
Date :
2013-11-05 13:17:40 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอเป็น vb.netได้มั้ยค่ะ
|
 |
 |
 |
 |
Date :
2013-11-06 14:15:06 |
By :
สมองน้อย |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอเป็นvb.net ได้มั้ยค่ะ คุณmr.win
|
 |
 |
 |
 |
Date :
2013-11-08 13:34:13 |
By :
สมองน้อย |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Backup
|
 |
 |
 |
 |
Date :
2013-11-09 09:22:20 |
By :
ton |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Public Shared Sub WriteDataToFile(ByVal submittedDataTable As DataTable, ByVal submittedFilePath As String)
Dim i As Integer = 0
Dim sw As StreamWriter = Nothing
sw = New StreamWriter(submittedFilePath, False)
For i = 0 To submittedDataTable.Columns.Count - 1- 1 Step i + 1
sw.Write(submittedDataTable.Columns(i).ColumnName + ";")
Next
sw.Write(submittedDataTable.Columns(i).ColumnName)
sw.WriteLine()
Dim row As DataRow
For Each row In submittedDataTable.Rows
Dim array() As Object = row.ItemArray
For i = 0 To array.Length - 1- 1 Step i + 1
sw.Write(array(i).ToString() + ";")
Next
sw.Write(array(i).ToString())
sw.WriteLine()
Next
sw.Close()
End Sub
WriteDataToFile(dt,"/path/thaicreate.txt")
|
 |
 |
 |
 |
Date :
2013-11-09 10:23:32 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|