扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
Column | Name | Property |
1 | activityid | DataType=System.Int32 Autoincrement=True AutoincrementSeed=1 AutoincrementStep=1 Unique=True |
2 | taskid | DataType=System.Int32 |
3 | description | DataType=System.String |
4 | startime | DataType=System.DateTime |
5 | endtime | DataType=System.DateTime |
Column | Name | Property |
1 | taskid | DataType=System.Int32 Autoincrement=True AutoincrementSeed=1 AutoincrementStep=1 Unique=True AllowDBNull=False |
2 | task | DataType=System.String AllowDBNull=False |
Column | Property |
activityid | Visible=False |
Taskid | ColumnType= DataGridViewComboBoxColumn DataSource= DsActivitiesTasks DataMember= tasks.task ValueMember=tasks.taskid |
description | Width=180 |
If CheckFileExistence() Then LoadDataSet() Else ’如果两个xml文件不存在,则创建这两个xml文件 CreateXMLFile() End If |
Dim myDocumentsFolder As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments Dim activitiesFileName As String = "\Activities.xml" Dim tasksFileName As String = "\Tasks.xml" Public activitiesFile As String = String.Concat(myDocumentsFolder, activitiesFileName) Public tasksFile As String = String.Concat(myDocumentsFolder, tasksFileName) |
Public Function CheckFileExistence() As Boolean ’检查两个xml文件是否存在 If My.Computer.FileSystem.FileExists(activitiesFile) And _ My.Computer.FileSystem.FileExists(tasksFile) Then Return True Else Return False End If End Function Public Sub CreateXMLFile() DsActivitiesTasks.Tasks.AddTasksRow("Email") DsActivitiesTasks.Tasks.AddTasksRow("Browsing") DsActivitiesTasks.Tasks.WriteXml(tasksFile, System.Data.XmlWriteMode.WriteSchema) DsActivitiesTasks.activities.WriteXml(activitiesFile, System.Data.XmlWriteMode.WriteSchema) End Sub |
Public Sub LoadDataSet() DsActivitiesTasks.tasks.ReadXml(tasksFile) DsActivitiesTasks.activities.ReadXml(activitiesFile) End Sub |
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles btnSave.Click Me.DsActivitiesTasks.activities.AcceptChanges() Me.DsActivitiesTasks.activities.WriteXml(activitiesFile, System.Data.XmlWriteMode.WriteSchema) End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles btnDelete.Click Me.DataGridView1.Rows.RemoveAt(Me.DataGridView1.CurrentRow.Index) btnSave_Click(sender, e) End Sub |
DataGridView1.DataSource = frmActivities.DsActivitiesTasks DataGridView1.DataMember = frmActivities.DsActivitiesTasks.tasks.TableName |
frmActivities.DsActivitiesTasks.tasks.AcceptChanges() frmActivities.DsActivitiesTasks.tasks.WriteXml(frmActivities.tasksFile, _ System.Data.XmlWriteMode.WriteSchema) |
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Me.DataGridView1.Rows.RemoveAt(Me.DataGridView1.CurrentRow.Index) btnSave_Click(sender, e) End Sub |
Dim frmtasks As New frmEditAddTasks frmtasks.ShowDialog() |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者