本文整理汇总了VB.NET中System.Data.Common.DataColumnMappingCollection.Item属性的典型用法代码示例。如果您正苦于以下问题:VB.NET DataColumnMappingCollection.Item属性的具体用法?VB.NET DataColumnMappingCollection.Item怎么用?VB.NET DataColumnMappingCollection.Item使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Data.Common.DataColumnMappingCollection
的用法示例。
在下文中一共展示了DataColumnMappingCollection.Item属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CreateColumnMappings
Public Sub CreateColumnMappings()
Dim mappings As New DataColumnMappingCollection()
mappings.Add("Category Name", "DataCategory")
mappings.Add("Description", "DataDescription")
mappings.Add("Picture", "DataPicture")
Dim message As String = "ColumnMappings:" + ControlChars.Cr
Dim i As Integer
For i = 0 To mappings.Count - 1
message += i.ToString() + " " + mappings(i).ToString() _
+ ControlChars.Cr
Next i
Console.WriteLine(message)
End Sub
示例2: FindDataColumnMapping
Public Sub FindDataColumnMapping()
' ...
' create columnMappings
' ...
If Not columnMappings.Contains("Description") Then
Console.WriteLine("Error: no such table in collection.")
Else
Console.WriteLine("Name: {0}", _
columnMappings("Description").ToString())
Console.WriteLine("Index: {0}", _
columnMappings.IndexOf("Description").ToString())
End If
End Sub