VB也是一样的,VB链接数据源的时候,会自动生成下面的代码。
- Public Class Form1
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- 'TODO: This line of code loads data into the 'NwindDataSet.Categories' table. You can move, or remove it, as needed.
- Me.CategoriesTableAdapter.Fill(Me.NwindDataSet.Categories)
- End Sub
- End Class
复制代码
你现在要做的就是把下面的代码写到模板里
- Public Class Template1
- Sub template()
- Me.CategoriesTableAdapter.Fill(Me.NwindDataSet.Categories)
- End Sub
- End Class
复制代码
或者你最好把你的工程发给我,我帮你Check. |