main.vb

来自「wrox出版社的另一套经典的VB2005数据库编程学习书籍,收集了书中源码,郑重」· VB 代码 · 共 23 行

VB
23
字号
Option Explicit On
Option Strict On
Imports System.Data

Public Class frmMain

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'NorthwindDataSet.Customers' table. You can move, or remove it, as needed.
        Me.CustomersTableAdapter.Fill(Me.NorthwindDataSet.Customers)
        Dim strPath As String = Application.StartupPath
        With Me.NorthwindDataSet
            .WriteXml(strPath + "CustsNoSchema.xml", XmlWriteMode.IgnoreSchema)
            .WriteXml(strPath + "CustsWithSchema.xml", XmlWriteMode.WriteSchema)
            .WriteXmlSchema(strPath + "CustsSchema.xsd")
        End With
    End Sub

    Private Sub bindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bindingNavigatorSaveItem.Click
        Me.CustomersBindingSource.EndEdit()
        Me.CustomersTableAdapter.Update(Me.NorthwindDataSet.Customers)
    End Sub
End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?