Export (0) Print
Expand All

DataSet.DataSetName Property

Gets or sets the name of the current DataSet.

[Visual Basic]
Public Property DataSetName As String
[C#]
public string DataSetName {get; set;}
[C++]
public: __property String* get_DataSetName();
public: __property void set_DataSetName(String*);
[JScript]
public function get DataSetName() : String;
public function set DataSetName(String);

Property Value

The name of the DataSet.

Example

[Visual Basic, C#, C++] The following example creates a new DataSet with the given DataSetName.

[Visual Basic] 
Private Sub CreateDataSet() 
   Dim myDataSet As DataSet
   myDataSet = New DataSet("SuppliersProducts")
   Console.WriteLine(myDataSet.DataSetName)
End Sub

[C#] 
private void CreateDataSet(){
   DataSet myDataSet = new DataSet("SuppliersProducts");
   Console.WriteLine(myDataSet.DataSetName);
   // Add a DataTable.
   myDataSet.Tables.Add(new DataTable("Suppliers"));
   // Add a DataColumn to the DataTable.
   myDataSet.Tables["Suppliers"].Columns.Add
   (new DataColumn("CompanyName", System.Type.GetType("System.String")));

}

[C++] 
private:
 void CreateDataSet(){
    DataSet* myDataSet = new DataSet(S"SuppliersProducts");
    Console::WriteLine(myDataSet->DataSetName);
    // Add a DataTable.
    myDataSet->Tables->Add(new DataTable(S"Suppliers"));
    // Add a DataColumn to the DataTable.
    myDataSet->Tables->Item[S"Suppliers"]->Columns->Add(
       new DataColumn(S"CompanyName", System::Type::GetType(S"System.String")));
 
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataSet Class | DataSet Members | System.Data Namespace | DataSet

Show:
© 2014 Microsoft