DataSet.DataSetName 属性

定义

获取或设置当前 DataSet 的名称。Gets or sets the name of the current DataSet.

public:
 property System::String ^ DataSetName { System::String ^ get(); void set(System::String ^ value); };
public string DataSetName { get; set; }
[System.Data.DataSysDescription("DataSetDataSetNameDescr")]
public string DataSetName { get; set; }
member this.DataSetName : string with get, set
Public Property DataSetName As String

属性值

DataSet 的名称。The name of the DataSet.

属性

示例

下面的示例使用给定的 DataSetName创建一个新的 DataSetThe following example creates a new DataSet with the given DataSetName.

private void CreateDataSet()
{
    DataSet dataSet = new DataSet("SuppliersProducts");
    Console.WriteLine(dataSet.DataSetName);

    // Add a DataTable.
    dataSet.Tables.Add(new DataTable("Suppliers"));

    // Add a DataColumn to the DataTable.
    dataSet.Tables["Suppliers"].Columns.Add
        (new DataColumn("CompanyName", 
        System.Type.GetType("System.String")));
}
Private Sub CreateDataSet() 
    Dim dataSet As DataSet
    dataSet = New DataSet("SuppliersProducts")
    Console.WriteLine(dataSet.DataSetName)
End Sub

适用于

另请参阅