' Create two instances of the `DataTable` object to reference the two tables
Dim tblCategories As DataTable = DS.Tables("Categories")
Dim tblProducts As DataTable = DS.Tables("Products")
' Create two DataColumn objects to reference the columns on which the relation is based
Dim colCatCategoryID As DataColumn = tblCategories.Columns("CategoryID")
Dim colProdCategoryID As DataColumn = tblProducts.Columns("CategoryID")
当我到达Dim colCatCategoryID As DataColumn = tblCategories.Columns("CategoryID")
时,收到以下错误消息:
对象引用未设置为对象的实例。